From 3913586f678437d6de80bc96c8eea0e1e69a51ac Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 5 Jul 2023 17:05:39 -0300 Subject: Updated tide --- .config/fish/functions/_tide_item_context.fish | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to '.config/fish/functions/_tide_item_context.fish') diff --git a/.config/fish/functions/_tide_item_context.fish b/.config/fish/functions/_tide_item_context.fish index 9dfa56d7..575c438c 100644 --- a/.config/fish/functions/_tide_item_context.fish +++ b/.config/fish/functions/_tide_item_context.fish @@ -1,9 +1,15 @@ function _tide_item_context if set -q SSH_TTY - tide_context_color=$tide_context_color_ssh _tide_print_item context $USER@$hostname + set -lx tide_context_color $tide_context_color_ssh + test "$tide_context_hostname_parts" = 0 && _tide_print_item context $USER || + h=(string split . $hostname) _tide_print_item context $USER@(string join . $h[..$tide_context_hostname_parts]) else if test "$EUID" = 0 - tide_context_color=$tide_context_color_root _tide_print_item context $USER@$hostname + set -lx tide_context_color $tide_context_color_root + test "$tide_context_hostname_parts" = 0 && _tide_print_item context $USER || + h=(string split . $hostname) _tide_print_item context $USER@(string join . $h[..$tide_context_hostname_parts]) else if test "$tide_context_always_display" = true - tide_context_color=$tide_context_color_default _tide_print_item context $USER@$hostname + set -lx tide_context_color $tide_context_color_default + test "$tide_context_hostname_parts" = 0 && _tide_print_item context $USER || + h=(string split . $hostname) _tide_print_item context $USER@(string join . $h[..$tide_context_hostname_parts]) end end -- cgit v1.2.3