Download:
child 6:b9fa9529a622
parent 4:2fb825b3c3ef
5:7b2ad8123a53
Anton Shestakov <engored@ya.ru>, Wed, 27 Jul 2011 22:10:28 +0800
virtualenv support.

1 файлов изменено, 11 вставок(+), 6 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Fri May 27 21:39:33 2011 +0900
+++ b/.bash_prompt Wed Jul 27 22:10:28 2011 +0800
@@ -12,13 +12,14 @@
local P="\[\e[1;35m\]"
local C="\[\e[1;36m\]"
- local PROMPT_TEMPLATE="$P{branch|quiet}@{rev}{$R{update}}{$G+{rev|merge}}$R{status|modified}"
+ local PROMPT_TEMPLATE="${P}{branch|quiet}@{rev}{$R{update}}{$G+{rev|merge}}$R{status|modified}${RESET}"
+ local TIME="${G}\t${RESET}"
if [[ ${EUID} == 0 ]] ; then
local PROMPT_COLOR="$R"
# getting hg info is disabled for root
- local MISC_INFO=" $P-"
+ local HG_INFO=" ${P}-${RESET}"
else
local PROMPT_COLOR="$G"
@@ -32,17 +33,21 @@
done
if [[ "$TRACKED" ]] ; then
- local MISC_INFO=" $(hg prompt $PROMPT_TEMPLATE)"
+ local HG_INFO=" $(hg prompt $PROMPT_TEMPLATE)"
fi
fi
+ if [[ "$VIRTUAL_ENV" ]] ; then
+ local VENV="${G}+"$(basename "$VIRTUAL_ENV")"${RESET}"
+ fi
+
if [[ "$RETURN_CODE" != 0 ]] ; then
- local PROMPT_PREFIX="$R${RETURN_CODE} "
+ local RETCODE="${R}${RETURN_CODE}${RESET} "
fi
PS1="\
-${BOLD}[$G\t ${RESET}\u@\h \
-${PROMPT_PREFIX}${RESET}\W${MISC_INFO}${RESET}${BOLD}]\
+${BOLD}[${TIME} \u@\h \
+${RETCODE}\W${VENV}${HG_INFO}${BOLD}]\
${PROMPT_COLOR}\\\$${RESET} "
}