fix(fish): more robust string escaping (#656)

fixes #653 

>
28f58e0641/television/utils/shell/completion.fish (L112)
> 
> This line should be
> 
> ```
> commandline -t -- (string escape -- "$dir$i")' '
> ```
> 
> This is a bug in the fish completion. Bash seems to be fine.
> 
> Testing with:
> 
> ```
> ❯ fish --version
> fish, version 4.0.2
> 
> ❯ mkdir -p "a/with whitespace"
> 
> ❯ cd a<ctrl-t>
> ```
> 
> Result:
> 
> ```
> ❯ cd a/'with whitespace/'
> ```
> 
> Expected result:
> 
> ```
> ❯ cd 'a/with whitespace/'
> ```
> 
> The fix on top gets this result.
This commit is contained in:
Alex Pasmantier 2025-07-19 23:05:31 +02:00 committed by GitHub
parent 098f3f4fe4
commit c8da07f3ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,9 +109,9 @@ function tv_smart_autocomplete
end
for i in $result
commandline -it -- $dir(string escape -- $i)' '
commandline -t -- (string escape -- "$dir$i")' '
# optional, if you want to replace '/home/foo/' with '~/', comment out above and uncomment below
# commandline -it -- (string replace --all $HOME '~' $dir(string escape -- $i))' '
# commandline -t -- (string replace --all $HOME '~' -- (string escape -- "$dir$i"))' '
end
end