Skip to content

Handle some annoyances in fish external completer #1955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cookbook/external_completers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ This completer will use [the fish shell](https://fishshell.com/) to handle compl

```nu
let fish_completer = {|spans|
fish --command $"complete '--do-complete=($spans | str join ' ')'"
fish --command $"complete '--do-complete=($spans | str replace "'" "\\'" | str join ' ')'"
| from tsv --flexible --noheaders --no-infer
| rename value description
| update value {
if ($in | path exists) {$'"($in | str replace "\"" "\\\"" )"'} else {$in}
if ($in | path exists) {$'"($in | path expand --no-symlink | str replace --all "\"" "\\\"" )"'} else {$in}
}
}
```
Expand Down