Merge branch 'tf/prompt-preserve-exit-status'
Using the exit status of the last command in the prompt, e.g. PS1='$(__git_ps1) $? ', did not work well because the helper function stomped on the exit status. * tf/prompt-preserve-exit-status: git-prompt: preserve value of $? inside shell prompt
This commit is contained in:
@ -288,6 +288,7 @@ __git_eread ()
|
|||||||
# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
|
# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
|
||||||
__git_ps1 ()
|
__git_ps1 ()
|
||||||
{
|
{
|
||||||
|
local exit=$?
|
||||||
local pcmode=no
|
local pcmode=no
|
||||||
local detached=no
|
local detached=no
|
||||||
local ps1pc_start='\u@\h:\w '
|
local ps1pc_start='\u@\h:\w '
|
||||||
@ -511,4 +512,7 @@ __git_ps1 ()
|
|||||||
else
|
else
|
||||||
printf -- "$printf_format" "$gitstring"
|
printf -- "$printf_format" "$gitstring"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# preserve exit status
|
||||||
|
return $exit
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user