zimfw / k

All kubectl aliases in one function.
MIT License
4 stars 2 forks source link

`command not found: _kubectl` when using autocomplete #3

Closed bisasuperstar closed 1 year ago

bisasuperstar commented 1 year ago

Describe the bug
When I press TAB for autocomplete I get command not found: _kubectl | _k:6: command not found: _kubectl

Steps to reproduce
I have the completion module sourced after the k module.

Whenever I try to press tab for autosuggestions I get the error above.

zimfw info

# In a terminal, run zimfw info, and paste the output here.
zimfw version:        1.11.3 (built at 2023-02-26 00:43:41 UTC, previous commit is 6a24459)
OSTYPE:               darwin22.1.0
TERM:                 xterm-256color
TERM_PROGRAM:         iTerm.app
TERM_PROGRAM_VERSION: 3.4.19
ZIM_HOME:             /Users/albi/.zim
ZSH_VERSION:          5.9
casret commented 1 year ago

I am also seeing this on a fresh install:


LANG:                 C.UTF-8
OSTYPE:               linux-gnu
TERM:                 xterm-256color
TERM_PROGRAM:         WezTerm
TERM_PROGRAM_VERSION: 20230712-072601-f4abf8fd
ZIM_HOME:             /home/casret/.zim
ZSH_VERSION:          5.8.1```
bisasuperstar commented 1 year ago

@casret - do you have the kubectl autocomplete installed by any chance?

casret commented 1 year ago

So what I did to work around this is to add the source <(command kubectl completions zsh> myself. I find it strange that it's commented out in the init.zsh.