diff --git a/functions/_tide_item_context.fish b/functions/_tide_item_context.fish index 2913063..9dfa56d 100644 --- a/functions/_tide_item_context.fish +++ b/functions/_tide_item_context.fish @@ -1,7 +1,7 @@ function _tide_item_context if set -q SSH_TTY tide_context_color=$tide_context_color_ssh _tide_print_item context $USER@$hostname - else if contains -- $USER root toor Administrator + else if test "$EUID" = 0 tide_context_color=$tide_context_color_root _tide_print_item context $USER@$hostname else if test "$tide_context_always_display" = true tide_context_color=$tide_context_color_default _tide_print_item context $USER@$hostname diff --git a/tests/_tide_item_context.test.fish b/tests/_tide_item_context.test.fish index 5ebf799..2d124f9 100644 --- a/tests/_tide_item_context.test.fish +++ b/tests/_tide_item_context.test.fish @@ -13,5 +13,5 @@ _context # CHECK: {{.*@.*}} set -g SSH_TTY /dev/pts/0 _context # CHECK: {{.*@.*}} -set USER root -_context # CHECK: {{root@.*}} +set EUID 0 +_context # CHECK: {{.*@.*}}