From bff515e24b305b39ca57af7c878f139d530b716e Mon Sep 17 00:00:00 2001 From: Krzysztof Mejka Date: Fri, 13 Dec 2019 09:14:47 +0100 Subject: [PATCH] Better virtualenv indicator With this change the virtualenv plugin will display not the virtualenv local folder name but the folder in which virtualenv is located. So, assuming these operations are executed ``` $ cd my_project $ virtualenv venv $ source venv/bin/activate ``` te virtualenv indicator with show `my_project` instead of `venv`. --- internal/p10k.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index def36276..5e117a1c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3126,7 +3126,7 @@ prompt_virtualenv() { if (( _POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION )) && _p9k_python_version; then msg="${_p9k_ret//\%/%%} " fi - local v=${VIRTUAL_ENV:t} + local v=${VIRTUAL_ENV:h:t} (( _POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES[(I)$v] )) && v=${VIRTUAL_ENV:h:t} msg+="$_POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${v//\%/%%}$_POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER" _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PYTHON_ICON' 0 '' "$msg"