mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-24 05:00:07 +00:00
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.
This commit is contained in:
parent
7e835be2d8
commit
f2772bd56f
1 changed files with 4 additions and 0 deletions
|
@ -4320,6 +4320,10 @@ prompt_virtualenv() {
|
|||
_virtualenv_load_name_poetry $idx
|
||||
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"
|
||||
case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in
|
||||
false)
|
||||
|
|
Loading…
Reference in a new issue