Skip to content

Commit be1404d

Browse files
authored
Fix VIRTUAL_ENV_PROMPT value in activator/activate (#13501)
## Summary <!-- What's the purpose of the change? What does it do, and why? --> I've compared all the activator scripts here with the original ones in https://github.com/pypa/virtualenv/tree/main/src/virtualenv/activation and only the bash/POSIX script here was yielding a VIRTUAL_ENV_PROMPT value with parenthesis and a trailing space, which should be part of the shell prompt (PS1 for bash/POSIX) but not of the VIRTUAL_ENV_PROMPT value itself. This fixes that small inconsistency. Fixes #13456 This reverts commit 0ec2d4e ## Test Plan <!-- How was it tested? --> I didn't test this locally.
1 parent 9d1a14e commit be1404d

File tree

1 file changed

+3
-3
lines changed
  • crates/uv-virtualenv/src/activator

1 file changed

+3
-3
lines changed

crates/uv-virtualenv/src/activator/activate

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ PATH="$VIRTUAL_ENV/{{ BIN_NAME }}:$PATH"
9999
export PATH
100100

101101
if [ "x{{ VIRTUAL_PROMPT }}" != x ] ; then
102-
VIRTUAL_ENV_PROMPT="({{ VIRTUAL_PROMPT }}) "
102+
VIRTUAL_ENV_PROMPT="{{ VIRTUAL_PROMPT }}"
103103
else
104-
VIRTUAL_ENV_PROMPT="($(basename "$VIRTUAL_ENV")) "
104+
VIRTUAL_ENV_PROMPT=$(basename "$VIRTUAL_ENV")
105105
fi
106106
export VIRTUAL_ENV_PROMPT
107107

@@ -113,7 +113,7 @@ fi
113113

114114
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
115115
_OLD_VIRTUAL_PS1="${PS1-}"
116-
PS1="${VIRTUAL_ENV_PROMPT}${PS1-}"
116+
PS1="(${VIRTUAL_ENV_PROMPT}) ${PS1-}"
117117
export PS1
118118
fi
119119

0 commit comments

Comments
 (0)