diff --git a/fish/functions/fish_right_prompt.fish b/fish/functions/fish_right_prompt.fish index 7e237f4..2635cfb 100644 --- a/fish/functions/fish_right_prompt.fish +++ b/fish/functions/fish_right_prompt.fish @@ -1,13 +1,13 @@ function fish_right_prompt - set -l ref (git symbolic-ref HEAD ^/dev/null) + set -l ref (git symbolic-ref HEAD 2>/dev/null) if test -z $ref return end - - git diff --no-ext-diff --quiet --exit-code ^/dev/null + + git diff --no-ext-diff --quiet --exit-code 2>/dev/null or set -l dirty 'yes' - git diff-index --cached --quiet HEAD -- ^/dev/null + git diff-index --cached --quiet HEAD -- 2>/dev/null or set -l staged 'yes' set_color normal @@ -21,7 +21,7 @@ function fish_right_prompt set_color green end echo -sn (string replace refs/heads/ '' -- $ref) - + set_color normal echo -sn ']' -end \ No newline at end of file +end