virtualenv
The smallest plugin in the roster: one function and one export. It provides
virtualenv_prompt_info for themes to display the active venv, and sets
VIRTUAL_ENV_DISABLE_PROMPT=1 so activate scripts stop scribbling
(venv) onto the prompt themselves.
Pro tips
- The export is the real feature. Without
VIRTUAL_ENV_DISABLE_PROMPT=1, everybin/activateprepends its own(venv)marker, which stacks on top of whatever the theme draws. With this plugin loaded, the prompt has exactly one venv indicator — the theme's. - Spaceship already has a venv section, so on this setup the indicator
you see comes from spaceship reading
$VIRTUAL_ENV, not fromvirtualenv_prompt_info. The plugin's job here is purely suppressing the duplicate. - It works with
uv venvenvironments — activation still sets$VIRTUAL_ENV, which is all the function and spaceship look at. If the prompt shows a genericvenv/.venvname, that's the directory name;uv venv --prompt myproj(orpython -m venv --prompt) sets$VIRTUAL_ENV_PROMPT, which this function prefers. - No indicator at all with
uv run— that's expected and fine.uv runnever activates anything in your shell, so there is no state for a prompt to warn you about. The indicator only matters when yousource .venv/bin/activate(orvrun) and might forget you did.