docs(virtualenv): Document how the virtual env prompt is computed

This commit is contained in:
Heinrich Kruger 2025-03-12 19:22:59 +00:00
parent 480f254157
commit 689787e117
No known key found for this signature in database
GPG key ID: 334F351709C5FC59

View file

@ -7,9 +7,14 @@ 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`.
The plugin creates a `virtualenv_prompt_info` function that you can use in your
theme. It displays the prompt string set in the `$VIRTUAL_ENV_PROMPT`
environment variable. The `activate` scripts for most Python virtual environment
implementations set this variable to the value provided via the `--prompt`
option when creating the virtual environment, or the basename of the environment
directory if the option was not provided. For implementations that do not set
`$VIRTUAL_ENV_PROMPT`, the plugin will display the basename of the virtual
environment directory instead.
It uses two variables to control how that is shown: