Skip to content

Commit d8b615f

Browse files
authored
Respect VIRTUAL_ENV_PROMPT variable (#701)
Whenever `VIRTUAL_ENV_PROMPT` is set, use it when injecting the venv name into the prompt. Fixes #539.
1 parent 5c21580 commit d8b615f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pure.zsh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ prompt_pure_precmd() {
223223
# When VIRTUAL_ENV_DISABLE_PROMPT is empty, it was unset by the user and
224224
# Pure should take back control.
225225
if [[ -n $VIRTUAL_ENV ]] && [[ -z $VIRTUAL_ENV_DISABLE_PROMPT || $VIRTUAL_ENV_DISABLE_PROMPT = 12 ]]; then
226-
psvar[12]="${VIRTUAL_ENV:t}"
226+
if [[ -n $VIRTUAL_ENV_PROMPT ]]; then
227+
psvar[12]="${VIRTUAL_ENV_PROMPT}"
228+
else
229+
psvar[12]="${VIRTUAL_ENV:t}"
230+
fi
227231
export VIRTUAL_ENV_DISABLE_PROMPT=12
228232
fi
229233

0 commit comments

Comments
 (0)