From eb685697e673fed3f7ec8e8e94f67c27552f881b Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 26 Mar 2009 19:40:50 +0100 Subject: display exitcode in prompt --- .zsh/rc/15prompt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to '.zsh') diff --git a/.zsh/rc/15prompt b/.zsh/rc/15prompt index 5eb75ec..e4e062f 100644 --- a/.zsh/rc/15prompt +++ b/.zsh/rc/15prompt @@ -19,8 +19,7 @@ prompt_eof_setup() { prompt_eof_setup "$@" - - +EXITCODE="%(?..(%?%1) )" # function to show the current git branch in prompt parse_git_branch() { @@ -35,9 +34,9 @@ parse_git_branch() { precmd () { # this has to be on the edge or you have some spaces in the prompt # if you have any workaround please tell -PS1="${fg_light_red}$USERNAME${fg_no_colour}@${fg_light_green}%m${fg_no_colour} \ +PROMPT="${fg_light_red}$USERNAME${fg_no_colour}@${fg_light_green}%m${fg_no_colour} \ - ${fg_light_blue}%~${fg_no_colour} ${fg_purple}$(parse_git_branch)${fg_no_colour} -[${fg_cyan}%*${fg_no_colour}] > " +[${fg_cyan}%*${fg_no_colour}] ${fg_red}$EXITCODE${fg_no_colour}> " } ## Spelling prompt -- cgit v1.2.3-24-g4f1b