2023-10-08 22:26:07 -05:00
|
|
|
function _tide_item_context
|
|
|
|
if set -q SSH_TTY
|
2023-11-19 14:34:47 -06:00
|
|
|
set -fx tide_context_color $tide_context_color_ssh
|
2023-10-08 22:26:07 -05:00
|
|
|
else if test "$EUID" = 0
|
2023-11-19 14:34:47 -06:00
|
|
|
set -fx tide_context_color $tide_context_color_root
|
2023-10-08 22:26:07 -05:00
|
|
|
else if test "$tide_context_always_display" = true
|
2023-11-19 14:34:47 -06:00
|
|
|
set -fx tide_context_color $tide_context_color_default
|
|
|
|
else
|
|
|
|
return
|
2023-10-08 22:26:07 -05:00
|
|
|
end
|
2023-11-19 14:34:47 -06:00
|
|
|
|
|
|
|
string match -qr "^(?<h>(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname
|
|
|
|
_tide_print_item context $USER$h
|
2023-10-08 22:26:07 -05:00
|
|
|
end
|