Solvedyay zsh completion seems to not work

Affected Version

yay v9.4.2.r8.g3fef09e - libalpm v12.0.0


Hi, for some reason, zsh completions seems to not work for me. I am not very well versed in zsh configuration, here are relevant options in my ~/.zshrc


export LANG=en_US.UTF-8

if [[ ! -d $ZSH_CACHE_DIR ]]; then
  mkdir $ZSH_CACHE_DIR

source $ZSH/

autoload -Uz +X compinit && compinit
autoload -Uz +X bashcompinit && bashcompinit

zstyle ':completion::complete:*' gain-privileges 1
zstyle ':completion:*' menu select
zstyle :compinstall filename '/home/otaj/.zshrc'
zstyle ':completion:*' rehash true

It is entirely possible, that it is only a misconfiguration, however, no completion related to yay is shown (removing packages, offering packages to install, nothing). Completion works in other places, as expected (namely pacman).

Thanks for any pointers regarding how to enable zsh completions.

26 Answers

✔️Accepted Answer


I had this issue on zsh and the solution was to rm ~/.cache/yay/completion.cache

Other Answers:

This seems highly related to robbyrussell/oh-my-zsh#7642 and is not specific to yay.
I had to apply the workaround in there (deleting *.zcoredump on each startup) to make yay auto completion work, also applies to some other applications but not all.

Yes. That was it. After cleaning the ~/.zcompdump* files and starting a new terminal, things are working fine. @otaj are you using oh-my-zsh as well?