summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
Diffstat (limited to 'themes')
-rw-r--r--themes/ys.zsh-theme10
1 files changed, 10 insertions, 0 deletions
diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme
index 95067060b..303c898b4 100644
--- a/themes/ys.zsh-theme
+++ b/themes/ys.zsh-theme
@@ -37,6 +37,15 @@ ys_hg_prompt_info() {
fi
}
+# Virtualenv
+local venv_info='$(virtenv_prompt)'
+YS_THEME_VIRTUALENV_PROMPT_PREFIX=" %{$fg[green]%}"
+YS_THEME_VIRTUALENV_PROMPT_SUFFIX=" %{$reset_color%}%"
+virtenv_prompt() {
+ [[ -n ${VIRTUAL_ENV} ]] || return
+ echo "${YS_THEME_VIRTUALENV_PROMPT_PREFIX}${VIRTUAL_ENV:t}${YS_THEME_VIRTUALENV_PROMPT_SUFFIX}"
+}
+
local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"
# Prompt format:
@@ -57,6 +66,7 @@ PROMPT="
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
${hg_info}\
${git_info}\
+${venv_info}\
\
%{$fg[white]%}[%*] $exit_code
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"