summaryrefslogtreecommitdiffstats
path: root/bashrc/common
diff options
context:
space:
mode:
Diffstat (limited to 'bashrc/common')
-rw-r--r--bashrc/common/prompt.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/bashrc/common/prompt.sh b/bashrc/common/prompt.sh
index f7db66e..d1efebe 100644
--- a/bashrc/common/prompt.sh
+++ b/bashrc/common/prompt.sh
@@ -7,7 +7,7 @@ export PS2="$(pcolor lblue)> $(pcolor)"
export PS3="$(color lblue)#? $(color)"
__make_prompt() {
- local PS1UH PS1D PS1R PS1F PS1P PS1BO PS1BC user host rc=$? s
+ local PS1UH PS1D PS1R PS1F PS1P PS1BO PS1BC PS1VE user host rc=$? s
# username + nodename
if [[ $(id -u) -eq 0 ]]; then
@@ -33,6 +33,9 @@ __make_prompt() {
# environment flags
[[ "${TERM#screen}" != "${TERM}" ]] && PS1F="${PS1F}$(pcolor lcyan)s$(pcolor)"
+ # python virtual env
+ [[ -n "${VIRTUAL_ENV}" ]] && PS1VE="$(pcolor lred)<${VIRTUAL_ENV#${WORKON_HOME}/}>$(pcolor) "
+
# prompt character
PS1P="$(pcolor lblue)\\\$ $(pcolor)"
@@ -100,7 +103,7 @@ __make_prompt() {
s="${s} "
fi
- export PS1="${PS1UH}${PS1D} ${PS1BO}${PS1R}${PS1F}${PS1BC} ${s}${PS1P}"
+ export PS1="${PS1VE}${PS1UH}${PS1D} ${PS1BO}${PS1R}${PS1F}${PS1BC} ${s}${PS1P}"
if [[ "${TERM#screen}" != "${TERM}" ]]; then
_hostname=$(hostname)