From 96cecaafd943add2acf5edcfd554eeff43c507f7 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Thu, 6 Jul 2023 21:14:40 -0700 Subject: [PATCH] use string matching in context item --- functions/_tide_item_context.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/_tide_item_context.fish b/functions/_tide_item_context.fish index 3be831f..cbdf420 100644 --- a/functions/_tide_item_context.fish +++ b/functions/_tide_item_context.fish @@ -9,6 +9,6 @@ function _tide_item_context return end - 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]) + string match -qr "^(?(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname + _tide_print_item context $USER$h end