[Informative VCS Prompt] Print failing exit codes

Before this change, if a command failed, this was indicated by the "$"
at the end of the prompt turning red.

With this change in place, if a command fails, the exit code of the
failing command is displayed in [square brackets].
This commit is contained in:
Johan Walles 2017-12-04 08:54:52 +01:00 committed by Fabian Homborg
parent 4bcd0413f8
commit 0e9d52bc41

View file

@ -90,9 +90,9 @@ function fish_prompt --description 'Write out the prompt'
if not test $last_status -eq 0 if not test $last_status -eq 0
set_color $fish_color_error set_color $fish_color_error
echo -n "[$last_status] "
set_color normal
end end
echo -n "$suffix " echo -n "$suffix "
set_color normal
end end