File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -649,7 +649,13 @@ function gp_add_virtualenv_to_prompt {
649
649
local ACCUMULATED_VENV_PROMPT=" "
650
650
local VENV=" "
651
651
if [[ -n " ${VIRTUAL_ENV-} " && -z " ${VIRTUAL_ENV_DISABLE_PROMPT+x} " ]]; then
652
- VENV=$( basename " ${VIRTUAL_ENV} " )
652
+ if [[ -n " ${VIRTUAL_ENV_PROMPT-} " ]]; then
653
+ # first trim any starting white space and parenthesis, and then do the same to the end
654
+ VENV=" ${VIRTUAL_ENV_PROMPT# " ${VIRTUAL_ENV_PROMPT%% [![:space:]]* } (" } "
655
+ VENV=" ${VENV% " )${VENV##* [![:space:]]} " } "
656
+ else
657
+ VENV=$( basename " ${VIRTUAL_ENV} " )
658
+ fi
653
659
ACCUMULATED_VENV_PROMPT=" ${ACCUMULATED_VENV_PROMPT}${GIT_PROMPT_VIRTUALENV// _VIRTUALENV_/ ${VENV} } "
654
660
fi
655
661
if [[ -n " ${NODE_VIRTUAL_ENV-} " && -z " ${NODE_VIRTUAL_ENV_DISABLE_PROMPT+x} " ]]; then
You can’t perform that action at this time.
0 commit comments