virtualenv
segment
Description
This segment is a "meta-segment" to show virtual environment information.
For now, only python
is supported. as it is the only one I use. If you want to
add support of another virtual environment, like nix, guix, npm, feel free to
contribute, I'll be glad to help as much as I can.
As it only support python
for now, this segment is only shown when global
variable VIRTUAL_ENV
exists and is not empty. For python
, this usually means
you activate the python virtual environment with command like:
# Usually, manuall done with:
source .venv/bin/activate
The virtual environment information is of the form
python_version:name_of_virtual_env
and is only shown when variable
VIRTUAL_ENV
exists and is not empty.
Requirements
This segment has no specific requirement as it depends on your virtual environment management software.
Variables
Variables | Default | Description |
---|---|---|
VIRTUALENV_CHAR |
|
Character to show before the segment content |
VIRTUALENV_FG |
white | Foreground color of segment |
VIRTUALENV_BG |
black | Background color of segment, only used by v2 |
Examples
Prompt v1 | Prompt v2 | |
---|---|---|
Full Version | ||
Maximum Short Version |