From 1df447ebc19da48d1813bd6f42916ec86683a3ad Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 18 Apr 2013 07:40:31 +0400 Subject: [PATCH] Record last exit code before running anything Otherwise powerline receieves value from the previous command in _powerline_prompt function. --- powerline/bindings/bash/powerline.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/powerline/bindings/bash/powerline.sh b/powerline/bindings/bash/powerline.sh index 15e34f58..50eb4878 100644 --- a/powerline/bindings/bash/powerline.sh +++ b/powerline/bindings/bash/powerline.sh @@ -13,9 +13,10 @@ _powerline_tmux_set_columns() { } _powerline_prompt() { + local last_exit_code=$? [[ -z "$POWERLINE_OLD_PROMPT_COMMAND" ]] || eval $POWERLINE_OLD_PROMPT_COMMAND - PS1="$(powerline shell left -r bash_prompt --last_exit_code=$?)" + PS1="$(powerline shell left -r bash_prompt --last_exit_code=$last_exit_code)" _powerline_tmux_set_pwd }