k0s
k0s copied to clipboard
Improve documentation for Zsh autocompletion
What happened? The existing documentation on how to enable zsh auto-completion is incorrect/missing information.
Expected behavior In this page: https://docs.k0sproject.io/v0.11.0/install/#zsh
The following should be removed:
# To load completions for each session, execute once:
$ k0s completion zsh > "${fpath[1]}/_k0s"
and replaced by
$ echo "source <(k0s completion zsh)" >> ~/.zshrc
The issue is marked as stale since no activity has been recorded in 30 days
That would run k0s on every shell invocation, not a best practice.
The usual way is something like:
k0s completion zsh > /usr/local/share/zsh/site-functions/_k0s
The current example of doing:
k0s completion zsh > "${fpath[1]}/_k0s"
may end up writing the file somewhere weird if you're using some zsh plugin framework, for example on my system it would go to /Users/kimmo/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/functions
.