Hello,
I installed the Incus package from the Ubuntu 24.04 repos, but autocomplete doesn’t seem to be working at all. Is there something special I need to do to get it to work? I’m using fish if that makes any difference.
Thanks.
Hello,
I installed the Incus package from the Ubuntu 24.04 repos, but autocomplete doesn’t seem to be working at all. Is there something special I need to do to get it to work? I’m using fish if that makes any difference.
Thanks.
Incus has autocomplete for the bash shell because the Incus package incus-client
comes with the autocomplete instructions. Once you install Incus, you can find the autocomplete rules at
$ ls -l /usr/share/bash-completion/completions/incus
lrwxrwxrwx 1 root root 40 Σεπ 7 05:19 /usr/share/bash-completion/completions/incus -> /opt/incus/share/bash_completion.d/incus
$
As far as I am aware, there are no fish autocomplete rules for fish yet. Therefore, if you want to port those autocompletion rules to fish, see, for example, here: shell - Convert bash function to fish's - Stack Overflow
incus completion fish
will give you a suitable completion profile.
Oh, there are already autocompletion rules then for Fish but also for PowerShell and ZSH (apart from Bash).
$ incus completion
Generate the autocompletion script for incus for the specified shell.
See each sub-command's help for details on how to use the generated script.
Usage:
incus completion [command]
Available Commands:
bash Generate the autocompletion script for bash
fish Generate the autocompletion script for fish
powershell Generate the autocompletion script for powershell
zsh Generate the autocompletion script for zsh
Global Flags:
--debug Show all debug messages
--force-local Force using the local unix socket
-h, --help Print help
--project Override the source project
-q, --quiet Don't show progress information
--sub-commands Use with help or --help to view sub-commands
-v, --verbose Show all information messages
--version Print version number
Use "incus completion [command] --help" for more information about a command.
$
The incus-client
package does ship with pre-generated completions for fish at /usr/share/fish/vendor_completions.d/incus.fish
. I don’t use fish myself, so if there’s something not right about how the completions have been installed please let me know and I can adjust the packaging.