ohmyzsh/plugins/virtualenv/README.md
Heinrich Kruger 480f254157
feat(virtualenv): Use $VIRTUAL_ENV_PROMPT if set
Modify the `virtualenv_prompt_info` function to use the prompt string
specified when creating the virtual environment, instead of just the
basename of the environment. If `VIRTUAL_ENV_PROMPT` is not set, fall
back to just using the basename of `$VIRTUAL_ENV`.
2025-03-11 22:12:20 +00:00

689 B

virtualenv

The plugin displays information of the created virtual container and allows background theming.

To use it, add virtualenv to the plugins array of your zshrc file:

plugins=(... virtualenv)

The plugin creates a virtualenv_prompt_info function that you can use in your theme. It displays the prompt string set when creating the virtual environment (via the --prompt option), falling back to the basename of the current $VIRTUAL_ENV.

It uses two variables to control how that is shown:

  • ZSH_THEME_VIRTUALENV_PREFIX: sets the prefix of the VIRTUAL_ENV. Defaults to [.

  • ZSH_THEME_VIRTUALENV_SUFFIX: sets the suffix of the VIRTUAL_ENV. Defaults to ].