virtualenv: Handle not being in a virtualenv

Pre-Poetry support, we only entered this codepath when we were inside a
virtualenv. Now we enter it for every directory, but we don't want to
display an empty segment for non-virtualenv locations.
pull/2450/head
Alex Jurkiewicz 1 year ago
parent 7e835be2d8
commit f2772bd56f

@ -4320,6 +4320,10 @@ prompt_virtualenv() {
_virtualenv_load_name_poetry $idx _virtualenv_load_name_poetry $idx
fi fi
fi fi
# Display nothing if there's no active virtualenv
if [[ -z $_virtualenv_name ]]; then
return
fi
msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${_virtualenv_name//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${_virtualenv_name//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER"
case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in
false) false)

Loading…
Cancel
Save