From e4ad3ed3e2fa5b0c0e59cabf8662781d1b47a5b3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 26 Aug 2013 15:09:22 +1200 Subject: Rearrange prompt to put last return status last --- bash/bashrc.d/prompt.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 6d273185..a3baaa3b 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -2,17 +2,17 @@ prompt() { # Variables for use only within this function - local -i ret=$? colors=$(tput colors) - local -a state=() local color reset branch info url root + local -i colors=$(tput colors) + local -a state=() # What's done next depends on the first argument to the function case $1 in # Turn complex, colored prompt on on) - PROMPT_COMMAND='history -a' - PS1='\[\a\][\u@\h:\w]$(prompt ret)$(prompt vcs)$(prompt job)\$' + PROMPT_COMMAND='ret=$? ; history -a' + PS1='\[\a\][\u@\h:\w]$(prompt vcs)$(prompt job)$(prompt ret)\$' # Check if we have non-bold bright green available if ((colors > 8)); then -- cgit v1.2.3