summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-12-05 03:20:53 +0300
committerGitHub <noreply@github.com>2017-12-05 03:20:53 +0300
commitefacc622a7891696b2c5c45229aa9617970c4399 (patch)
tree4cc3759262f979788c94803c1292f41b873751b3 /powerlevel9k.zsh-theme
parent25b9ee84c23ee3a9461c433048a4d510e351d15c (diff)
parentbc8a83208f9b4aa8fcc29cc35a0eeec3ae67c5b9 (diff)
Merge pull request #680 from dinhnv/pyenv-patched
pyenv promt segment uses $PYENV_VERSION environment variable"
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme14
1 files changed, 3 insertions, 11 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 27608382..33f8a50b 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1379,18 +1379,10 @@ prompt_virtualenv() {
}
# pyenv: current active python version (with restrictions)
-# More information on pyenv (Python version manager like rbenv and rvm):
-# https://github.com/yyuu/pyenv
-# the prompt parses output of pyenv version and only displays the first word
+# https://github.com/pyenv/pyenv#choosing-the-python-version
prompt_pyenv() {
- local pyenv_version="$(pyenv version 2>/dev/null)"
- pyenv_version="${pyenv_version%% *}"
- # XXX: The following should return the same as above.
- # This reads better for devs familiar with sed/awk/grep/cut utilities
- # Using shell expansion/substitution may hamper future maintainability
- #local pyenv_version="$(pyenv version 2>/dev/null | head -n1 | cut -d' ' -f1)"
- if [[ -n "$pyenv_version" && "$pyenv_version" != "system" ]]; then
- "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version" 'PYTHON_ICON'
+ if [[ -n "$PYENV_VERSION" ]]; then
+ "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$PYENV_VERSION" 'PYTHON_ICON'
fi
}