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.
This commit is contained in:
Shubham Utwal 2016-11-19 02:14:32 +05:30 committed by GitHub
parent 3477ff2527
commit 22a7c9a281

View File

@ -1,5 +1,9 @@
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`')'
}
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" 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_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "