Fixing kubectl autocompletion for an alias in Zsh
With the upcoming switch in MacOS to use Zsh rather than Bash, I decided to
Zsh a shot as well for my setup. The setup (Zsh + oh-my-zsh) has been great
so far. However, autocompletion for my alias of kubectl (k
) using the
common way to setup aliases with autocompletion caused a segfault in the shell.
Since probably many people hit this issue at some point, I figured I’d share the workaround that I am using to have a kubectl alias with autocompletion.
So, to work around this issue, I sourced the autocompletion of kubectl
manually, replacing the kubectl command with the k
alias: