From 23fdcb8048976e91b0486738fc2b5769c2a188b0 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Mon, 27 Feb 2017 10:37:15 +0100 Subject: [PATCH 1/2] Display superuser glyph when using fakeroot --- fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 7253799..3c2cd4d 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -383,7 +383,7 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display symbols for a and set nonzero $__bobthefish_nonzero_exit_glyph # if superuser (uid == 0) - [ (id -u $USER) -eq 0 ] + [ (id -u) -eq 0 ] and set superuser $__bobthefish_superuser_glyph # Jobs display From cb6bb0ecb365fece11ccfe8dd84c19a28517af77 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Mon, 27 Feb 2017 20:44:01 +0100 Subject: [PATCH 2/2] Use a different glyph color when using fakeroot --- fish_prompt.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 3c2cd4d..d248022 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -404,7 +404,12 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display symbols for a if [ "$superuser" ] set_color normal - set_color -b $__color_initial_segment_su + if [ -z "$FAKEROOTKEY" ] + set_color -b $__color_initial_segment_su + else + set_color -b $__color_initial_segment_exit + end + echo -n $__bobthefish_superuser_glyph end