mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-25 21:40:08 +00:00
pyenv promt segment uses $PYENV_VERSION environment variable"
This commit is contained in:
parent
87acc51aca
commit
bc8a83208f
1 changed files with 3 additions and 11 deletions
|
@ -1379,18 +1379,10 @@ prompt_virtualenv() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# pyenv: current active python version (with restrictions)
|
# pyenv: current active python version (with restrictions)
|
||||||
# More information on pyenv (Python version manager like rbenv and rvm):
|
# https://github.com/pyenv/pyenv#choosing-the-python-version
|
||||||
# https://github.com/yyuu/pyenv
|
|
||||||
# the prompt parses output of pyenv version and only displays the first word
|
|
||||||
prompt_pyenv() {
|
prompt_pyenv() {
|
||||||
local pyenv_version="$(pyenv version 2>/dev/null)"
|
if [[ -n "$PYENV_VERSION" ]]; then
|
||||||
pyenv_version="${pyenv_version%% *}"
|
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$PYENV_VERSION" 'PYTHON_ICON'
|
||||||
# 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'
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue