Skip to content

Commit

Permalink
fix(fish): don't add extra space to prompt if it's an implicit cd (`\…
Browse files Browse the repository at this point in the history
….`) (#259)

Fixes #256
  • Loading branch information
alexpasmantier authored Jan 9, 2025
1 parent 3b7fb0c commit b388a56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/television-utils/shell/completion.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b388a56

Please sign in to comment.