Add virtualenv to pure theme

pull/934/head
Mike Matz 2016-04-26 07:25:35 -07:00
parent f3d229e5cb
commit 5dd75d3fd9
1 changed files with 9 additions and 2 deletions

View File

@ -31,11 +31,18 @@ pure_prompt() {
ps_root_mark="${red} # ${normal}"
ps_path="${yellow}\w${normal}";
# Virtualenv
if [[ $VIRTUAL_ENV != "" ]]; then
venv="(${VIRTUAL_ENV##*/})"
else
venv=""
fi
# make it work
case $(id -u) in
0) PS1="$ps_root@$ps_host$(scm_prompt):$ps_path$ps_root_mark"
0) PS1="${venv}$ps_root@$ps_host$(scm_prompt):$ps_path$ps_root_mark"
;;
*) PS1="$ps_user@$ps_host$(scm_prompt):$ps_path$ps_user_mark"
*) PS1="${venv}$ps_user@$ps_host$(scm_prompt):$ps_path$ps_user_mark"
;;
esac
}