summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2011-01-18 21:32:21 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2011-01-18 21:32:21 +0000
commit01a46fc90cc12e3505f32330daae196acbd128eb (patch)
treeda3b5c16d819096c16a0664833df65b565f5e4ab /zshrc
parent4aea571502cb99c38910aada740c991c04a3aee5 (diff)
zshrc with error code in prompt
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@470 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc7
1 files changed, 5 insertions, 2 deletions
diff --git a/zshrc b/zshrc
index 6178f4a..7ed1f02 100644
--- a/zshrc
+++ b/zshrc
@@ -331,11 +331,13 @@ function init-prompt() {
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${PR_RED}:${YELLOW}%r"
fi
+ local exitcodeprompt
+ exitcodeprompt='%0(?..${PR_RED}e%?${PR_NO_COLOUR}:)'
if [ "`id -u`" = "0" -o ! -x /usr/bin/id ] ; then
- export PROMPT='${debian_chroot:+[$debian_chroot] }${VCS_INFO_message_0_}%n@%m:%~# '
+ export PROMPT="${exitcodeprompt}"'${debian_chroot:+[$debian_chroot] }${VCS_INFO_message_0_}%n@%m:%~# '
export TITLE="%n@%m: %~"
else
- export PROMPT='${debian_chroot:+[$debian_chroot] }${VCS_INFO_message_0_}%n@%m:%~$ '
+ export PROMPT="${exitcodeprompt}"'${debian_chroot:+[$debian_chroot] }${VCS_INFO_message_0_}%n@%m:%~$ '
export TITLE="%n@%m: %~"
fi
}
@@ -355,3 +357,4 @@ fi
[ -f COMMANDMENTS ] && cat COMMANDMENTS
[ -e $HOME/.zshrc-local ] && . $HOME/.zshrc-local
[ -e $HOME/.pal ] && [ -e /usr/bin/pal ] && pal -r 5-10
+true