From 4d46f6eddac96d7195a88e4ba14adb1610938fb6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 27 Nov 2013 01:37:32 +0900 Subject: [PATCH] shrc: fix showing last status in PS1 --- shrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shrc b/shrc index 1a0fd66..a548f33 100755 --- a/shrc +++ b/shrc @@ -1194,5 +1194,12 @@ __my_set_title(){ } PROMPT_COMMAND="__my_set_title \${USER}@\${HOSTNAME}\:\${PWD}; __my_set_screen_title \$(basename \"\$PWD\")/" -PROMPT_COMMAND="laststatus=\$?;$PROMPT_COMMAND" +if $inzsh +then + precmd(){ + laststatus=$? + } +else + PROMPT_COMMAND="laststatus=\$?;$PROMPT_COMMAND" +fi laststatus=0