Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda virtual environment #70

Open
ms3056 opened this issue Oct 22, 2020 · 1 comment
Open

Add conda virtual environment #70

ms3056 opened this issue Oct 22, 2020 · 1 comment

Comments

@ms3056
Copy link

ms3056 commented Oct 22, 2020

Please consider adding the Python Environment name to the front of the string like:

(python3.7) Blah Blah>Blah Blah>

Thanks!

@DemirTonchev
Copy link

I was able to add conda env like this:


---------------- show conda venv 

local function get_py_env(env_var)
    env = clink.get_env(env_var)
    if env then
        return env
    end

    return false
end

local function get_conda_env_filter()
    local env = get_py_env("CONDA_DEFAULT_ENV")

    if env then
        env = addTextWithColor("[", env.."] ", ansiFgClrWhite  , ansiBgClrBlack)
        clink.prompt.value = string.gsub(clink.prompt.value, plc_prompt_lambSymbol, env..plc_prompt_lambSymbol)
    end

    return false
end

-- Register this addon with Clink
clink.prompt.register_filter(get_conda_env_filter, 100)
clink.prompt.register_filter(addAddonSegment, 55)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants