grafana / tanka

Flexible, reusable and concise configuration for Kubernetes
https://tanka.dev
Apache License 2.0
2.41k stars 166 forks source link

Completions don't work in ZSH #722

Open Hubro opened 2 years ago

Hubro commented 2 years ago

Here is my ZSH completion config:

# {{{ ZSH completion config

fpath=(~/Dropbox/Config/zsh-completions $fpath)

zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' max-errors 2
zstyle :compinstall filename '/home/tomas/.zshrc'

autoload -Uz compinit
compinit

autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/bin/tk tk

# }}}

Completions for tk don't work, if I type tk and press tab, I only get filename completions, just as I get with commands with no completion support.

Is my existing completion configuration incompatible with "bashcompinit" or something like that?


➜ tk --version
tk version 0.22.0

The completions work as expected in bash:

complete -C /usr/bin/tk tk
Volatus commented 1 year ago

@Hubro pretty sure ZSH completion is not available due to the project's choice of completion library.

zerok commented 6 months ago

I tried loading the completion with this

autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/tk tk

and as far as I can tell the completion works. I'm not sure what changed since then, though, as cli-x and posener/complete have still the same version since back then.