summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-06-20 10:37:40 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-06-20 10:37:40 +0300
commitca311575d6a967b938703cb68eaa8354def0f421 (patch)
treedd24508c4cd7d26a71826fa444fc23df24e292b8
parent93c24c0e2cfe182d1f09b84f764961f6f256516a (diff)
add POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION
-rwxr-xr-xinternal/p10k.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index e61be29f..5dbe4d87 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1975,10 +1975,15 @@ prompt_vi_mode() {
# Virtualenv: current working virtualenv
# More information on virtualenv (Python):
# https://virtualenv.pypa.io/en/latest/
+set_default POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION true
prompt_virtualenv() {
- if [[ -n "$VIRTUAL_ENV" ]]; then
- "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" 'PYTHON_ICON' 0 '' "${${${VIRTUAL_ENV:t}//\%/%%}//\\/\\\\}"
+ [[ -n $VIRTUAL_ENV ]] || return
+ local msg=''
+ if [[ $POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION == true ]] && _p9k_python_version; then
+ msg="$_P9K_RETVAL "
fi
+ msg+=${${${VIRTUAL_ENV:t}//\%/%%}//\\/\\\\}
+ "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" 'PYTHON_ICON' 0 '' "$msg"
}
function _p9k_read_pyenv_version_file() {