From 01a46fc90cc12e3505f32330daae196acbd128eb Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 18 Jan 2011 21:32:21 +0000 Subject: zshrc with error code in prompt git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@470 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- zshrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'zshrc') 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 -- cgit v1.2.3