mirror of
https://github.com/alexpasmantier/television.git
synced 2025-07-29 06:11:37 +00:00
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:
parent
098f3f4fe4
commit
c8da07f3ed
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user