Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #680 from dinhnv/pyenv-patched
Browse files Browse the repository at this point in the history
pyenv promt segment uses $PYENV_VERSION environment variable"
  • Loading branch information
bhilburn authored Dec 5, 2017
2 parents 25b9ee8 + bc8a832 commit efacc62
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit efacc62

Please sign in to comment.