include exit status indicator in robbyrussell sample prompt

This commit is contained in:
mus0u 2017-03-13 18:02:14 -05:00 committed by Kurtis Rader
parent 98f4e49669
commit b4f70cb98b

View file

@ -2,6 +2,7 @@
# author: Bruno Ferreira Pinto, Pawel Zubrycki
function fish_prompt
set -l __last_command_exit_status $status
if not set -q -g __fish_robbyrussell_functions_defined
set -g __fish_robbyrussell_functions_defined
@ -58,12 +59,18 @@ function fish_prompt
set -l cyan (set_color -o cyan)
set -l yellow (set_color -o yellow)
set -l red (set_color -o red)
set -l green (set_color -o green)
set -l blue (set_color -o blue)
set -l normal (set_color normal)
set -l arrow "$red"
set -l arrow_color "$green"
if test $__last_command_exit_status != 0
set arrow_color "$red"
end
set -l arrow "$arrow_color"
if [ $USER = 'root' ]
set arrow "$red# "
set arrow "$arrow_color# "
end
set -l cwd $cyan(basename (prompt_pwd))