diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2022-01-14 15:59:00 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2022-01-14 15:59:05 +0300 |
commit | 161f4c1f0475b9370697d31b180e6b097c297ddf (patch) | |
tree | 967b348a8c33754f99916bbb73be4d88e92f391f /internal/p10k.zsh | |
parent | b8ddcd4c17c650c49087b6993383e865206b7212 (diff) |
respect VIRTUAL_ENV_PROMPT if its value is different from the default (#1718)
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r-- | internal/p10k.zsh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 54ab71df..802cdf95 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4224,7 +4224,11 @@ prompt_virtualenv() { msg="${_p9k__ret//\%/%%} " fi local v=${VIRTUAL_ENV:t} - [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]] && v=${VIRTUAL_ENV:h:t} + if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($v) " ]]; then + v=$VIRTUAL_ENV_PROMPT[2,-3] + elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then + v=${VIRTUAL_ENV:h:t} + fi msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" case $_POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV in false) |