aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 6dc2e8a4..8ba844f3 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4038,6 +4038,8 @@ function _p9k_pyenv_global_version() {
# Segment to display pyenv information
# https://github.com/pyenv/pyenv#choosing-the-python-version
prompt_pyenv() {
+ unset P9K_PYENV_PYTHON_VERSION
+
local v=${(j.:.)${(@)${(s.:.)PYENV_VERSION}#python-}}
if [[ -n $v ]]; then
(( ${_POWERLEVEL9K_PYENV_SOURCES[(I)shell]} )) || return
@@ -4084,6 +4086,14 @@ prompt_pyenv() {
[[ $v == system ]] && return
fi
+ local versions=${PYENV_ROOT:-$HOME/.pyenv}/versions
+ versions=${versions:A}
+ local version=$versions/$v
+ version=${version:A}
+ if [[ $version == (#b)$versions/([^/]##)* ]]; then
+ typeset -g P9K_PYENV_PYTHON_VERSION=$match[1]
+ fi
+
_p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "${v//\%/%%}"
}