From 2b5b6af002f8fb73a8412e7b951a5b87d2c0b9c0 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 13 Mar 2014 20:35:20 +0400 Subject: [PATCH] Put _powerline_prompt at the start Reason: $? may be overridden by the previous commands in PROMPT_COMMAND that do not keep it like _powerline_prompt does (see `return $last_exit_code`). (@ascrane) Closes #836 --- powerline/bindings/bash/powerline.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerline/bindings/bash/powerline.sh b/powerline/bindings/bash/powerline.sh index ca9e1792..c5d56e7c 100644 --- a/powerline/bindings/bash/powerline.sh +++ b/powerline/bindings/bash/powerline.sh @@ -47,7 +47,7 @@ _powerline_prompt() { return $last_exit_code } -[[ "$PROMPT_COMMAND" != "${PROMPT_COMMAND/_powerline_prompt/}" ]] || - export PROMPT_COMMAND="${PROMPT_COMMAND}"$'\n'"_powerline_prompt" +test "x$PROMPT_COMMAND" != "x${PROMPT_COMMAND%_powerline_prompt*}" || + export PROMPT_COMMAND=$'_powerline_prompt\n'"${PROMPT_COMMAND}" _powerline_init_tmux_support