From 7554ce91fcf771041326430c0a224b9e570424a0 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 27 May 2015 15:12:48 +0200 Subject: Added exit status signaling to custom fish prompt --- fish/.config/fish/functions/fish_prompt.fish | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'fish') diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish index b21d479..bcf8ef7 100644 --- a/fish/.config/fish/functions/fish_prompt.fish +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -1,4 +1,6 @@ function fish_prompt + set last_status $status + if not set -q __fish_prompt_normal set -g __fish_prompt_normal (set_color normal) end @@ -19,5 +21,13 @@ function fish_prompt end end - echo -n -s 'λ ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" ' ▸ ' + echo -n -s 'λ ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" + + if test $last_status -gt 0 + set_color $fish_color_cwd_root + echo -n -s ' ▸ ' + set_color normal + else + echo -n -s ' ▸ ' + end end -- cgit v1.2.3