Skip to content

Guide showing how to add shell completions in Fish #1288

@FabianLars

Description

@FabianLars

In #1283 we've added docs for bash, zsh and powershell, however tauri completions also supports fish but i've had issues coming up with something nice having 0 experience with Fish and being vegan, #1283 (comment).

A short recap of my assumptions in the linked comments:

  • The completion file should be in ~/.local/share/fish/vendor_completions.d/ or ~/.config/fish/completions/.
  • The completion file must have the same name as the first command so that fish loads it
    • This means the file must have the name cargo.fish, npm.fish, etc.
    • This is fine if there is no file for that command already or if that file is in the same folder we're writing too (probably unlikely looking at the possible paths and their conditions: https://fishshell.com/docs/current/completions.html#where-to-put-completions
    • We can't just create a new file if there already exists one since it would prevent fish from loading the others, or the tauri one depending on the order. I'd rather not look through all dirs fish loads completions from to do source /path/to/whatever.fish either.

ideally we'd want to have a tauri.fish in one of the aforementioned dir which triggers on tauri, cargo tauri, yarn tauri and npm run tauri but i could not find a way to do this and therefore i'm hoping that actual fish users may know more than me :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementDoes it add or improve content?

    Type

    No type

    Projects

    Status

    💪 Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions