* ``__VENV_NAME__`` is replaced with the environment name (final path
segment of environment directory).
+ * ``__VENV_PROMPT__`` is replaced with the prompt (the environment
+ name surrounded by parentheses and with a following space)
+
* ``__VENV_BIN_NAME__`` is replaced with the name of the bin directory
(either ``bin`` or ``Scripts``).
being processed.
"""
text = text.replace('__VENV_DIR__', context.env_dir)
- text = text.replace('__VENV_NAME__', context.prompt)
+ text = text.replace('__VENV_NAME__', context.env_name)
+ text = text.replace('__VENV_PROMPT__', context.prompt)
text = text.replace('__VENV_BIN_NAME__', context.bin_name)
text = text.replace('__VENV_PYTHON__', context.env_exe)
return text
function global:_OLD_VIRTUAL_PROMPT {""}\r
copy-item function:prompt function:_OLD_VIRTUAL_PROMPT\r
function global:prompt {\r
- Write-Host -NoNewline -ForegroundColor Green '__VENV_NAME__'\r
+ Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'\r
_OLD_VIRTUAL_PROMPT\r
}\r
\r
)\r
\r
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"\r
-set "PROMPT=__VENV_NAME__%PROMPT%"\r
+set "PROMPT=__VENV_PROMPT__%PROMPT%"\r
\r
if defined PYTHONHOME (\r
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"\r
if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
- if [ "x__VENV_NAME__" != x ] ; then
- PS1="__VENV_NAME__$PS1"
+ if [ "x__VENV_PROMPT__" != x ] ; then
+ PS1="__VENV_PROMPT__$PS1"
else
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
# with the original prompt function renamed, we can override with our own.
function fish_prompt
# Prompt override?
- if test -n "__VENV_NAME__"
- printf "%s%s%s" "__VENV_NAME__" (set_color normal) (_old_fish_prompt)
+ if test -n "__VENV_PROMPT__"
+ printf "%s%s%s" "__VENV_PROMPT__" (set_color normal) (_old_fish_prompt)
return
end
# ...Otherwise, prepend env