-
Notifications
You must be signed in to change notification settings - Fork 154
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
How to show active python virtual environment in prompt? #5
Comments
Hi @Tset-Noitamotua This looks promising! clink.prompt.register_filter(colorful_git_prompt_filter, 60) Here |
I'll try it. What is the rank for? Is it kind of a prioraty to which filter will apply? |
That's great @Tset-Noitamotua |
I did a fork. New repo is here: cmder-powerline-venv-prompt Cheers |
@AmrEldib can we link out to their repository in the readme.md here? |
Hi, I tried your solution @Tset-Noitamotua but unfortunately when I'm activating any of the virtualenvs I get this:
Any idea what might be causing it? |
Up with JorgeGRC, debugging right now. |
@JorgeGRC Did you ever figure out the cause? I can't seem to find the exports variable in any of the |
Fixed my issue. For anyone who may be running into the Solution 1: Solution 2:
Then modify the line which is set to access the function as written here in the same file I'm sure there is another solution to the issue which seems to be causing the script to not be able to access the |
so if cmder supports showing env's by default, and powerline breaks this feature and this enhancement no longer works... what is the proper solution? this is my solution for conda 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.." ", ansiFgClrYellow, ansiBgClrBlack)
clink.prompt.value = string.gsub(clink.prompt.value, plc_prompt_lambSymbol, env..plc_prompt_lambSymbol)
end
return false
end
clink.prompt.register_filter(get_conda_env_filter, 100) |
Is there a way to add virtualenv next to the git as another prompt module? Also anyone have a working solution for pipenv (without the hash values) |
So, Is this something that could work with the portable version? |
I have not tested it with the portable version.
Josh Chrestman <notifications@github.com> schrieb am Di., 2. Apr. 2019,
17:30:
… So, Is this something that could work with the portable version?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFX9hv681Pd-TCotBiGeafsyT6rIK641ks5vc3d0gaJpZM4LZ5xN>
.
|
@Tset-Noitamotua A simple creation of the pyenv_prompt_config.lua didn't do anything. No errors, and the env seems to have been activated, but theres no change in the console. Im also using activate <env_name> rather than workon... not sure if clink cares about that? Very unfamiliar with all this lua config. |
Me, too have no clue about lua :-)
maybe the maintainer of the repo I forked from can help you.
Actually I switched to Linux cause I was tired of all the extra steps
needed when it comes to setup all the cool stuff. It was always like: u see
something cool on Mac or Linux then have to go and find a workaround to
achive the same on Windows :-(
Josh Chrestman <notifications@github.com> schrieb am Di., 2. Apr. 2019,
17:42:
… @Tset-Noitamotua <https://github.com/Tset-Noitamotua> A simple creation
of the pyenv_prompt_config.lua didn't do anything. No errors, and the env
seems to have been activated, but theres no change in the console.
Im also using activate <env_name> rather than workon... not sure if clink
cares about that? Very unfamiliar with all this lua config.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFX9hktI6EQEatqpAqU_0I-J6sbMxQcnks5vc3pwgaJpZM4LZ5xN>
.
|
I have used below code (in file
C:\tools\cmder\config\pyenv_prompt_config.lua
) to display which virtual python env is activated. It's not my code, I have found it on Github or Stackoverflow and I have no clue about Lua :(Could it be combined somehow with your cmder-powerline-prompt?
Thats how it looked:
Cheers
Tset
The text was updated successfully, but these errors were encountered: