From 6c74dc0167f9e506e148f8c6c76feb9c273cf49e Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Fri, 20 Dec 2013 15:44:04 +0100 Subject: [PATCH] bash: fix last rc in prompt --- bash/prompt | 2 +- bash/rc | 2 ++ bash/term_title | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bash/prompt b/bash/prompt index cd0ee6a..7829583 100644 --- a/bash/prompt +++ b/bash/prompt @@ -57,7 +57,7 @@ set_prompt() { fi # exit code - [[ $last_exit_code -ne 0 ]] && PS1+=" ${BW}${last_exit_code}" + [[ $LAST_CMD_RC -ne 0 ]] && PS1+=" ${BW}${LAST_CMD_RC}" # closing prompt PS1+="${B}]" diff --git a/bash/rc b/bash/rc index 3556564..b78b70f 100644 --- a/bash/rc +++ b/bash/rc @@ -12,8 +12,10 @@ source $DOTFILES_SHELL_DIR/bundler source $DOTFILES_SHELL_DIR/go precmd() { + LAST_CMD_RC=$? clear_incomplete_line set_prompt + update_terminal_cwd set_term_title } diff --git a/bash/term_title b/bash/term_title index 607d116..442ff1c 100644 --- a/bash/term_title +++ b/bash/term_title @@ -9,7 +9,6 @@ if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" printf '\e]7;%s\a' "$PWD_URL" } - PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND" fi set_term_title() {