From 23659ec04c8ffc5920f8e99727cef6673f3829ed Mon Sep 17 00:00:00 2001 From: Alexandre Pasmantier Date: Thu, 9 Jan 2025 13:37:33 +0100 Subject: [PATCH] fix(fish): don't add extra space to prompt if it's an implicit cd (`\.`) --- crates/television-utils/shell/completion.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/television-utils/shell/completion.fish b/crates/television-utils/shell/completion.fish index 6e84ebe..f828c66 100644 --- a/crates/television-utils/shell/completion.fish +++ b/crates/television-utils/shell/completion.fish @@ -4,8 +4,8 @@ function tv_smart_autocomplete set -l output (tv --autocomplete-prompt "$current_prompt") if test -n "$output" - # add a space if the prompt does not end with one - string match -q "* " -- "$current_prompt" || set current_prompt "$current_prompt " + # add a space if the prompt does not end with one (unless the prompt is an implicit cd, e.g. '\.') + string match -r '.*( |./)$' -- "$current_prompt" || set current_prompt "$current_prompt " commandline -r "$current_prompt$output" end end