Add support for showing what virtualenv is currently active
This works with virtualenvwrapper to detect when a virtualenv is activated and adds "(<name>)" before the path that's being displayed.pull/39/head
parent
1638a1a435
commit
ba9b5d22df
|
|
@ -25,13 +25,20 @@ doubletime_scm_prompt() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtualenv_prompt() {
|
||||||
|
if [ ! -z "$VIRTUAL_ENV" ]
|
||||||
|
then
|
||||||
|
echo "(`basename $VIRTUAL_ENV`) "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
prompt_setter() {
|
prompt_setter() {
|
||||||
# Save history
|
# Save history
|
||||||
history -a
|
history -a
|
||||||
history -c
|
history -c
|
||||||
history -r
|
history -r
|
||||||
PS1="
|
PS1="
|
||||||
\t $(scm_char) [\[$THEME_PROMPT_HOST_COLOR\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] \w
|
\t $(scm_char) [\[$THEME_PROMPT_HOST_COLOR\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] $(virtualenv_prompt)\w
|
||||||
$(doubletime_scm_prompt)\[$reset_color\] $ "
|
$(doubletime_scm_prompt)\[$reset_color\] $ "
|
||||||
PS2='> '
|
PS2='> '
|
||||||
PS4='+ '
|
PS4='+ '
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue