From 22a7c9a28194e1fe6008c2ead2266f8851fec386 Mon Sep 17 00:00:00 2001 From: Shubham Utwal Date: Sat, 19 Nov 2016 02:14:32 +0530 Subject: [PATCH] PROMPT var updated to display venv base name (py) To display the active python virtualenv base name inside the 'prompt', added a script and injected it in the PROMPT variable. --- themes/robbyrussell.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-theme index f9eca6a87..02a288db1 100644 --- a/themes/robbyrussell.zsh-theme +++ b/themes/robbyrussell.zsh-theme @@ -1,5 +1,9 @@ +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`')' +} + local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" -PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' +PROMPT='${ret_status}%{$fg[cyan]%}$(virtualenv_info) %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "