From b4f70cb98b094a963584ce79bb29f2ea562dc02c Mon Sep 17 00:00:00 2001 From: mus0u Date: Mon, 13 Mar 2017 18:02:14 -0500 Subject: [PATCH] include exit status indicator in robbyrussell sample prompt --- .../tools/web_config/sample_prompts/robbyrussell.fish | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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))