From eef87cc78659d958f978f5809c57cbb928c5fcc3 Mon Sep 17 00:00:00 2001 From: Tim Otlik Date: Thu, 3 May 2018 09:32:30 +0200 Subject: [PATCH] add `POWERLEVEL9K_VIRTUALENV_SHOW_VERSION` option to virtualenv segment --- powerlevel9k.zsh-theme | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 8f06866fb..b62b3c258 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1570,6 +1570,10 @@ prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" if [[ -n "$virtualenv_path" && "$VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(basename "$virtualenv_path")" 'PYTHON_ICON' + + if [[ -v "POWERLEVEL9K_VIRTUALENV_SHOW_VERSION" && "$POWERLEVEL9K_VIRTUALENV_SHOW_VERSION" == true ]]; then + "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))')" + fi fi }