-
-
Notifications
You must be signed in to change notification settings - Fork 983
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
Prompt virtualenv name does not respect Python's venv --prompt argument #539
Comments
Not sure what we can do here, this information isn't available via environment variables, so there's no good way for us to detect the custom prompt 😞. |
Ah, you're correct. Found this Python issue discussing that. I do know it does work on powerlevel10k—addressed in this issue—though it's not clear to me how they achieve it. |
Ok, looks like p10k has a whitelist for "generic" virtualenv names, if it detects one than it uses the name of the parent folder. For instance: If we go this same route, I'm hoping we can avoid maintaining a list of generic names but perhaps we could allow the user to define one. I don't know if anyone really wants to name their virtualenv |
It's configurable in p10k. Here's the parameter's default value: typeset -g POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES=(virtualenv venv .venv env) |
Looks like some support for this has landed in python/cpython#21587 but unfortunately it won't be of any use to us 😞. It doesn't actually set the new variable, |
I submitted a PR to address this, let's see how it goes: python/cpython#22324 |
so close... 😅 good luck on the PR! and thanks for writing it up! so many prompts would benefit from this change. |
General information
System report (output of
prompt_pure_system_report
):''
❯
1.10.3
export VIRTUAL_ENV_DISABLE_PROMPT=12
typeset -g PROMPT=$'%F{${prompt_pure_colors[path]}}%~%f %F{248}${prompt_pure_vcs_info[branch]}%F{13}${prompt_pure_git_dirty}%f %{ %}%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f '
Other information
I have:
Problem description
Python's venv has an optional argument where you may specify a prompt prefix via
--prompt
. I expect this name to be reflected in the prompt. When activating the pure theme, it does not respect the--prompt
name and instead uses the directory name.Reproduction steps
With pure theme
Without pure theme
% source .venv/bin/activate (test) %
The text was updated successfully, but these errors were encountered: