zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.73k stars 122 forks source link

[bug]: kubectl not loading when zinit snippet OMZP::kubectl #652

Open exic opened 2 months ago

exic commented 2 months ago

What happened?

I set up my system on Mac and found that kubectl autocompletion isn't working:

(eval):1: command not found: _kubectl

Two issues, probably:

Steps to reproduce

  1. (install kubectl)
  2. zinit snippet OMZP::kubectl
  3. k [TAB]

Relevant output

No response

Screenshots and recordings

No response

Operating System & Version

OS: darwin23.0 | Vendor: apple | Machine: x86_64 | CPU: arm64 | Processor: arm | Hardware: arm64

Zsh version

zsh 5.9 (x86_64-apple-darwin23.0)

Terminal emulator

xterm-256color

If using WSL on Windows, which version of WSL

None

Additional context

https://github.com/ohmyzsh/ohmyzsh/blob/master/oh-my-zsh.sh#L65 https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/kubectl/kubectl.plugin.zsh#L13

https://github.com/zdharma-continuum/CODE_OF_CONDUCT.md isn't available btw., but I agree to follow ;-)

Code of Conduct

AbaoFromCUG commented 1 month ago

Same for me, when use zinit snippet OMZP::docker, related issue in https://github.com/ohmyzsh/ohmyzsh/issues/11866

Possible solution, do some thing like ohmyzsh: create $ZSH_CACHE_DIR/completions and add to fpath, refer to https://github.com/ohmyzsh/ohmyzsh/blob/2ef7c73cc884163367279e4b586136e3335b1c53/oh-my-zsh.sh#L56-L57