Skip to content

Commit fe1c1e7

Browse files
committed
Escape singlequotes in fish_completer
In case the completion string has any singlequotes, escape them before passing it to external fish command. Else the completion will fail due to unmatched quotes. eg. vim '/home <tab>
1 parent cd9b542 commit fe1c1e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/external_completers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This completer will use [the fish shell](https://fishshell.com/) to handle compl
2020

2121
```nu
2222
let fish_completer = {|spans|
23-
fish --command $"complete '--do-complete=($spans | str join ' ')'"
23+
fish --command $"complete '--do-complete=($spans | str replace "'" "\\'" | str join ' ')'"
2424
| from tsv --flexible --noheaders --no-infer
2525
| rename value description
2626
| update value {

0 commit comments

Comments
 (0)