From c793f60845f03deb33e45c06d55c89f260803689 Mon Sep 17 00:00:00 2001 From: tomwei7 Date: Sun, 11 Dec 2016 13:01:09 +0800 Subject: [PATCH] add virtualenv support --- themes/ys.zsh-theme | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme index 89d5355d..482bf66f 100644 --- a/themes/ys.zsh-theme +++ b/themes/ys.zsh-theme @@ -35,6 +35,15 @@ ys_hg_prompt_info() { fi } +# Virtualenv info +export VIRTUAL_ENV_DISABLE_PROMPT=1 +local virtualenv_info='$(virtualenv_prompt_info)' +virtualenv_prompt_info() { + if [ ! -z "${VIRTUAL_ENV}" ] ; then + echo -n " ve:$fg[cyan]$(basename $VIRTUAL_ENV)" + fi +} + local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})" # Prompt format: @@ -53,6 +62,7 @@ PROMPT=" %{$fg[green]%}%m \ %{$fg[white]%}in \ %{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\ +${virtualenv_info}\ ${hg_info}\ ${git_info}\ \