52:17b5c2356d70
Anton Shestakov <engored@ya.ru>, 2014-09-04
New screenshots and an updated readme.

next change 54:065779098328
previous change 45:a12c1aeefbfe

.bash_prompt

Permissions: -rw-r--r--

Other formats: Feeds:
0
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
#!/bin/bash
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
function prompt_command {
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local RETURN_CODE="$?"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
# dark, light, bold
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local Rd="\[\e[0;31m\]"; local R="\[\e[0;91m\]"; local Rb="\[\e[1;31m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local Gd="\[\e[0;32m\]"; local G="\[\e[0;92m\]"; local Gb="\[\e[1;32m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local Yd="\[\e[0;33m\]"; local Y="\[\e[0;93m\]"; local Yb="\[\e[1;33m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local Bd="\[\e[0;34m\]"; local B="\[\e[0;94m\]"; local Bb="\[\e[1;34m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local Pd="\[\e[0;35m\]"; local P="\[\e[0;95m\]"; local Pb="\[\e[1;35m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local Cd="\[\e[0;36m\]"; local C="\[\e[0;96m\]"; local Cb="\[\e[1;36m\]"
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $TERM == 'linux' ]] ; then
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
R=$Rb
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
G=$Gb
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
Y=$Yb
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
B=$Bb
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
P=$Pb
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
C=$Cb
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
fi
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local BOLD="\[\e[1m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local RESET="\[\e[0m\]"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local TIME="${G}\t${RESET}"
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $RETURN_CODE != 0 ]] ; then
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local RETCODE="${R}${RETURN_CODE}${RESET} "
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
fi
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
if [[ $EUID == 0 ]] ; then
3
3:cb307dcaf2ef More quotes.
Anton Shestakov <engored@ya.ru>
previous changes: 2:9c916e36d032
line | diff
local PROMPT_COLOR="$R"
2
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
# getting hg and git info is disabled for root
5
5:7b2ad8123a53 virtualenv support.
Anton Shestakov <engored@ya.ru>
previous changes: 3:cb307dcaf2ef
line | diff
local HG_INFO=" ${P}-${RESET}"
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
local GIT_INFO=" ${G}-${RESET}"
2
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
else
3
3:cb307dcaf2ef More quotes.
Anton Shestakov <engored@ya.ru>
previous changes: 2:9c916e36d032
line | diff
local PROMPT_COLOR="$G"
2
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
# testing if current dir is a part of hg/git repo
3
3:cb307dcaf2ef More quotes.
Anton Shestakov <engored@ya.ru>
previous changes: 2:9c916e36d032
line | diff
local TEST_DIR="$PWD"
2
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
while true ; do
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
[[ -d "$TEST_DIR/.hg" ]] && local HG_TRACKED=1 && break
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
[[ -d "$TEST_DIR/.git" ]] && local GIT_TRACKED=1 && break
3
3:cb307dcaf2ef More quotes.
Anton Shestakov <engored@ya.ru>
previous changes: 2:9c916e36d032
line | diff
[[ "$TEST_DIR" == '/' ]] && break
2
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
TEST_DIR=$(dirname "$TEST_DIR")
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
done
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $HG_TRACKED && $USE_HG_PROMPT ]] ; then
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local PROMPT_TEMPLATE="${P}{branch|quiet}{${Rd}{closed}}${P}☿{rev}{${B}+{tags|quiet|+}}{${Gd}*{bookmark}}{${R}{update}}{${G}+{rev|merge}}${R}{status|modified}${RESET}"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
local HG_INFO=" $(hg prompt $PROMPT_TEMPLATE)"
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
fi
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $HG_TRACKED && ! $USE_HG_PROMPT ]] ; then
33
33:b0de9677e28d .bash_prompt cleanup, unification.
Anton Shestakov <engored@ya.ru>
previous changes: 32:ec26c70bf440
line | diff
local SUM=$(LC_ALL=C hg sum 2>/dev/null)
32
32:ec26c70bf440 Save on echo.
Anton Shestakov <engored@ya.ru>
previous changes: 30:3327ef700923
line | diff
local PARENTS=($(grep -Po '(?<=parent: ).*(?=:)' <<< "$SUM"))
32:ec26c70bf440 Save on echo.
Anton Shestakov <engored@ya.ru>
previous changes: 30:3327ef700923
line | diff
local BRANCH=$(grep -Po '(?<=branch: ).*$' <<< "$SUM")
32:ec26c70bf440 Save on echo.
Anton Shestakov <engored@ya.ru>
previous changes: 30:3327ef700923
line | diff
local COMMIT=$(grep -Po '(?<=commit: ).*$' <<< "$SUM")
32:ec26c70bf440 Save on echo.
Anton Shestakov <engored@ya.ru>
previous changes: 30:3327ef700923
line | diff
local UPDATE=$(grep -Po '(?<=update: ).*$' <<< "$SUM")
30
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
local REV=${PARENTS[0]}
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
local MERGEREV=${PARENTS[1]}
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
BRANCH=${BRANCH/default/}
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
[ -z "$MERGEREV" ] || MERGEREV="+$MERGEREV"
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
case "$COMMIT" in
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
*'(clean)'*)
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
COMMIT=''
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
;;
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
*added*|*modified*|*deleted*)
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
COMMIT='!'
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
;;
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
esac
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
case "$UPDATE" in
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
*'(update)'*)
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
UPDATE='^'
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
;;
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
*'(merge)'*)
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
UPDATE=''
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
;;
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
*'(current)'*)
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
UPDATE=''
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
;;
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
esac
30:3327ef700923 Replace hg-prompt-dependent mercurial prompt with hg sum, bash and grep.
Anton Shestakov <engored@ya.ru>
previous changes: 28:dda34692ae7d
line | diff
local HG_INFO=" ${P}${BRANCH}${REV}${R}${UPDATE}${G}${MERGEREV}${R}${COMMIT}${RESET}"
2
2:9c916e36d032 Renamed .bashrc to .bash_prompt. Disabled any hg interaction for root.
Anton Shestakov <engored@ya.ru>
previous changes: 1:ef4ec926e9a4
line | diff
fi
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
if [[ $GIT_TRACKED ]] ; then
33
33:b0de9677e28d .bash_prompt cleanup, unification.
Anton Shestakov <engored@ya.ru>
previous changes: 32:ec26c70bf440
line | diff
local GIT_STATUS=$(LC_ALL=C git status 2>/dev/null)
33:b0de9677e28d .bash_prompt cleanup, unification.
Anton Shestakov <engored@ya.ru>
previous changes: 32:ec26c70bf440
line | diff
local GIT_BRANCH=$(grep -Po '(?<=On branch ).*$' <<< "$GIT_STATUS")
38
38:aeaac3ebe25e Show current git hash.
Anton Shestakov <engored@ya.ru>
previous changes: 35:44a6ddc7f222
line | diff
local GIT_REV=$(LC_ALL=C git rev-parse --short HEAD 2>/dev/null)
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $GIT_STATUS == *'Your branch is behind'* ]] ; then
39
39:06ada8ea9a31 Behind and ahead of branches in git.
Anton Shestakov <engored@ya.ru>
previous changes: 38:aeaac3ebe25e
line | diff
local GIT_BEHIND="$R^"
40
40:48d26a4c35ba Ahead/behind commit count.
Anton Shestakov <engored@ya.ru>
previous changes: 39:06ada8ea9a31
line | diff
[[ $GIT_STATUS =~ behind[^$'\n']+([0-9]+)' 'commit ]] && GIT_BEHIND+=${BASH_REMATCH[1]}
39
39:06ada8ea9a31 Behind and ahead of branches in git.
Anton Shestakov <engored@ya.ru>
previous changes: 38:aeaac3ebe25e
line | diff
fi
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $GIT_STATUS == *'Your branch is ahead'* ]] ; then
39
39:06ada8ea9a31 Behind and ahead of branches in git.
Anton Shestakov <engored@ya.ru>
previous changes: 38:aeaac3ebe25e
line | diff
local GIT_AHEAD="$Y^"
40
40:48d26a4c35ba Ahead/behind commit count.
Anton Shestakov <engored@ya.ru>
previous changes: 39:06ada8ea9a31
line | diff
[[ $GIT_STATUS =~ ahead[^$'\n']+([0-9]+)' 'commit ]] && GIT_AHEAD+=${BASH_REMATCH[1]}
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
fi
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $GIT_STATUS == *'Changes to be committed'* ]] ; then
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
local GIT_STAGED="$R!"
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
fi
42
42:34ee83bd5ad2 local again. Lotsa colors. hg prompt is back, controlled by USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 40:48d26a4c35ba
line | diff
if [[ $GIT_STATUS == *'Changes not staged'* ]] ; then
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
local GIT_UNSTAGED="$P?"
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
fi
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
39
39:06ada8ea9a31 Behind and ahead of branches in git.
Anton Shestakov <engored@ya.ru>
previous changes: 38:aeaac3ebe25e
line | diff
local GIT_INFO=" ${G}${GIT_BRANCH}±${GIT_REV}${GIT_BEHIND}${GIT_AHEAD}${GIT_STAGED}${GIT_UNSTAGED}${RESET}"
7
7:d3613e95e03f Git info. Git and Mercurial symbols (credit goes to Steve Losh and his extravagant zsh prompt).
Anton Shestakov <engored@ya.ru>
previous changes: 5:7b2ad8123a53
line | diff
fi
0
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
fi
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
if [[ $VIRTUAL_ENV ]] ; then
5
5:7b2ad8123a53 virtualenv support.
Anton Shestakov <engored@ya.ru>
previous changes: 3:cb307dcaf2ef
line | diff
local VENV="${G}+"$(basename "$VIRTUAL_ENV")"${RESET}"
5:7b2ad8123a53 virtualenv support.
Anton Shestakov <engored@ya.ru>
previous changes: 3:cb307dcaf2ef
line | diff
fi
5:7b2ad8123a53 virtualenv support.
Anton Shestakov <engored@ya.ru>
previous changes: 3:cb307dcaf2ef
line | diff
0
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
PS1="\
45
45:a12c1aeefbfe Let's try without bold at all.
Anton Shestakov <engored@ya.ru>
previous changes: 44:a6137e70b11c
line | diff
[${TIME} \u@\h \
45:a12c1aeefbfe Let's try without bold at all.
Anton Shestakov <engored@ya.ru>
previous changes: 44:a6137e70b11c
line | diff
${RETCODE}\W${VENV}${HG_INFO}${GIT_INFO}]\
0
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
${PROMPT_COLOR}\\\$${RESET} "
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
}
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
44
44:a6137e70b11c Guess USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 42:34ee83bd5ad2
line | diff
# first find prompt in hgrc, then check it's actually enabled
44:a6137e70b11c Guess USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 42:34ee83bd5ad2
line | diff
if grep -w '^prompt' ~/.hgrc &>/dev/null && hg help prompt &>/dev/null ; then
44:a6137e70b11c Guess USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 42:34ee83bd5ad2
line | diff
USE_HG_PROMPT=1
44:a6137e70b11c Guess USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 42:34ee83bd5ad2
line | diff
fi
44:a6137e70b11c Guess USE_HG_PROMPT.
Anton Shestakov <engored@ya.ru>
previous changes: 42:34ee83bd5ad2
line | diff
35
35:44a6ddc7f222 Unlocal colors, lose double quotes where not needed.
Anton Shestakov <engored@ya.ru>
previous changes: 34:6d42e8d89e7e
line | diff
export VIRTUAL_ENV_DISABLE_PROMPT=1
0
0:226664158c55 Added .bashrc with hg prompt example.
Anton Shestakov <engored@ya.ru>
previous changes:
line | diff
export PROMPT_COMMAND=prompt_command