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 @@ -653,7 +653,13 @@ function gp_add_virtualenv_to_prompt {
653
653
local ACCUMULATED_VENV_PROMPT=" "
654
654
local VENV=" "
655
655
if [[ -n " ${VIRTUAL_ENV-} " && -z " ${VIRTUAL_ENV_DISABLE_PROMPT+x} " ]]; then
656
- VENV=$( basename " ${VIRTUAL_ENV} " )
656
+ if [[ -n " ${VIRTUAL_ENV_PROMPT-} " ]]; then
657
+ # first trim any starting white space and parenthesis, and then do the same to the end
658
+ VENV=" ${VIRTUAL_ENV_PROMPT# " ${VIRTUAL_ENV_PROMPT%% [![:space:]]* } (" } "
659
+ VENV=" ${VENV% " )${VENV##* [![:space:]]} " } "
660
+ else
661
+ VENV=$( basename " ${VIRTUAL_ENV} " )
662
+ fi
657
663
ACCUMULATED_VENV_PROMPT=" ${ACCUMULATED_VENV_PROMPT}${GIT_PROMPT_VIRTUALENV// _VIRTUALENV_/ ${VENV} } "
658
664
fi
659
665
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