fix(fish): don't add extra space to prompt if it's an implicit cd (\.) (#259)

Fixes #256
This commit is contained in:
Alex Pasmantier 2025-01-09 13:41:38 +01:00 committed by GitHub
parent 3b7fb0c6d6
commit b388a56745
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,8 +4,8 @@ function tv_smart_autocomplete
set -l output (tv --autocomplete-prompt "$current_prompt") set -l output (tv --autocomplete-prompt "$current_prompt")
if test -n "$output" if test -n "$output"
# add a space if the prompt does not end with one # add a space if the prompt does not end with one (unless the prompt is an implicit cd, e.g. '\.')
string match -q "* " -- "$current_prompt" || set current_prompt "$current_prompt " string match -r '.*( |./)$' -- "$current_prompt" || set current_prompt "$current_prompt "
commandline -r "$current_prompt$output" commandline -r "$current_prompt$output"
end end
end end