Skip to content

Instantly share code, notes, and snippets.

@ariesmcrae
Last active August 29, 2023 13:25
Show Gist options
  • Save ariesmcrae/9be3be114e7bb36bcb5981820850ba2f to your computer and use it in GitHub Desktop.
Save ariesmcrae/9be3be114e7bb36bcb5981820850ba2f to your computer and use it in GitHub Desktop.
Why does my oh-my-zsh powerlevel10k prompt not show my python .venv virtual environment?

Why does my oh-my-zsh powerlevel10k prompt not show my python .venv virtual environment?

Your Powerlevel10k prompt might not be showing your Python virtual environment because it's configured to display the more informative name of the Python virtual environment. By default, Powerlevel10k may display the name of the directory containing the Python virtual environment rather than the less informative name "venv". This is more useful because it tells you which Python virtual environment is active rather than simply that a Python virtual environment is active.

However, you can change this configuration if you want. If you'd like your prompt to display "venv" when a Python virtual environment is active, you can add the following line to your ~/.p10k.zsh file:

typeset -g POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES=()

This will configure Powerlevel10k to display the less meaningful "venv" when a Python virtual environment is active. Please note that this will make your prompt less informative, which is why it's not the default setting.

Also, you might not have set the POWERLEVEL9K_VIRTUALENV_SHOW parameter to true in your ~/.p10k.zsh file. This parameter tells powerlevel10k to show the virtual environment's name in the prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment