bash: fix last rc in prompt

This commit is contained in:
Loic Nageleisen 2013-12-20 15:44:04 +01:00
parent d4b90d1df8
commit 6c74dc0167
3 changed files with 3 additions and 2 deletions

View file

@ -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}]"

View file

@ -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
}

View file

@ -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() {