From be1404df2a5429fdd661073b291528a047867c86 Mon Sep 17 00:00:00 2001 From: Eric Nielsen <4120606+ericbn@users.noreply.github.com> Date: Sat, 17 May 2025 06:48:09 -0500 Subject: [PATCH] Fix VIRTUAL_ENV_PROMPT value in activator/activate (#13501) ## Summary 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 0ec2d4e434878c6f99f7fea77b5236292a35093a ## Test Plan I didn't test this locally. --- crates/uv-virtualenv/src/activator/activate | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/uv-virtualenv/src/activator/activate b/crates/uv-virtualenv/src/activator/activate index 4be846e07..3c6b471b0 100644 --- a/crates/uv-virtualenv/src/activator/activate +++ b/crates/uv-virtualenv/src/activator/activate @@ -99,9 +99,9 @@ PATH="$VIRTUAL_ENV/{{ BIN_NAME }}:$PATH" export PATH if [ "x{{ VIRTUAL_PROMPT }}" != x ] ; then - VIRTUAL_ENV_PROMPT="({{ VIRTUAL_PROMPT }}) " + VIRTUAL_ENV_PROMPT="{{ VIRTUAL_PROMPT }}" else - VIRTUAL_ENV_PROMPT="($(basename "$VIRTUAL_ENV")) " + VIRTUAL_ENV_PROMPT=$(basename "$VIRTUAL_ENV") fi export VIRTUAL_ENV_PROMPT @@ -113,7 +113,7 @@ fi if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then _OLD_VIRTUAL_PS1="${PS1-}" - PS1="${VIRTUAL_ENV_PROMPT}${PS1-}" + PS1="(${VIRTUAL_ENV_PROMPT}) ${PS1-}" export PS1 fi