diff --git a/share/tools/web_config/sample_prompts/robbyrussell.fish b/share/tools/web_config/sample_prompts/robbyrussell.fish index 849273a22..a40dac735 100644 --- a/share/tools/web_config/sample_prompts/robbyrussell.fish +++ b/share/tools/web_config/sample_prompts/robbyrussell.fish @@ -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))