Wrong Python environment names
Hi,
when I activate a new environment, for some reason its name "sticks" to the Python segment:
- No Python seg
- Activate env
- Right name is displayed
- Activate other env
- Right name is displayed
- Deactivate
- No Python segment (as expected)
- Activate first environment
- Second name is displayed, and for any subsequent env
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
# Don't show Python version next to the virtual environment name.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=true
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
When setting POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION to true, it displays the correct Python version but still the wrong name.
What is the output of the following command when the wrong name is displayed?
typeset -p VIRTUAL_ENV
Right env, wrong display
Which segment is displaying "gfn-113" on the right? You can figure this out by commenting out all segments within POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS in ~/.p10k.zsh except one.
With virtualenv only in POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS:
(and still:
❯ typeset -p VIRTUAL_ENV
export VIRTUAL_ENV=/Users/victor/.virtualenvs/gflownet
)
(venv activate $NAME is a function to execute source ~/.virtualenvs/$NAME/bin/activate)
What's the output of this command?
typeset -p VIRTUAL_ENV_PROMPT
Looks like we're getting somewhere indeed
There you go. Powerlevel10k respects this override. If you don't want it, disable it in the virtualenv. I don't know how but I recall there is a way.
Ok thanks!
Putting export VIRTUAL_ENV_DISABLE_PROMPT=1 in my .zshrc fixes the issue.
👍