summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
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