mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-23 03:52:12 +03:00
Use EUID to detect superuser
This commit is contained in:
parent
132dff77da
commit
6906f7ece2
@ -1,7 +1,7 @@
|
|||||||
function _tide_item_context
|
function _tide_item_context
|
||||||
if set -q SSH_TTY
|
if set -q SSH_TTY
|
||||||
tide_context_color=$tide_context_color_ssh _tide_print_item context $USER@$hostname
|
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
|
tide_context_color=$tide_context_color_root _tide_print_item context $USER@$hostname
|
||||||
else if test "$tide_context_always_display" = true
|
else if test "$tide_context_always_display" = true
|
||||||
tide_context_color=$tide_context_color_default _tide_print_item context $USER@$hostname
|
tide_context_color=$tide_context_color_default _tide_print_item context $USER@$hostname
|
||||||
|
@ -13,5 +13,5 @@ _context # CHECK: {{.*@.*}}
|
|||||||
set -g SSH_TTY /dev/pts/0
|
set -g SSH_TTY /dev/pts/0
|
||||||
_context # CHECK: {{.*@.*}}
|
_context # CHECK: {{.*@.*}}
|
||||||
|
|
||||||
set USER root
|
set EUID 0
|
||||||
_context # CHECK: {{root@.*}}
|
_context # CHECK: {{.*@.*}}
|
||||||
|
Loading…
Reference in New Issue
Block a user