ohmyzsh
ohmyzsh copied to clipboard
z plugin tab completion doesn't work in zsh 5.9
Describe the bug
Using Debian testing (bookworm), fully updated as of today.
Using z plugin with Oh-My-Zsh doesn't work. When I type z
(+ Space
) and then press the Tab
key, instead of shows the most frequent directories, it shows the following output:
However, when I use the z
plugin without Oh-My-Zsh (i.e. only using Zsh and then source ~/.oh-my-zsh/plugins/z/z.zsh
, it works OK:
Steps to reproduce
- Enable plugin
z
. - Type
z
+ pressSpace
+ pressTab
key.
Expected behavior
It shows the most frequent directories and I can select one using the Tab
key.
Screenshots and recordings
No response
OS / Linux distribution
Debian testing (bookworm)
Zsh version
zsh 5.9 (x86_64-debian-linux-gnu)
Terminal emulator
Alacritty
If using WSL on Windows, which version of WSL
No response
Additional context
No response
At least in my case, the incorrect completions are coming from:
local/share/zsh/5.8.1.1-dev/functions/_compadd
which suggests the issue isn't with OMZ directly, but OMZ's use of compadd that triggers the problem.
OMZ does not use compadd
to change the z completion. It doesn't do anything extra apart from calling compinit
. When that is done in a non-OMZ shell with zsh 5.9, the bug appears again.
It looks like there's an incompatibility with how z uses compctl instead of compsys and zsh 5.9. I'm still investigating.
oh-my-zsh uses rupa's Z, right?
Not sure whether or not rupa is willing to make it compatible with newer ZSH versions, however, this gentlemen made it compatible: https://github.com/agkozak/zsh-z
I'm using it for a little bit and seems to be working fine with zsh 5.9.
Given rupa isn't a fan of ZSH (see issue 100 if curious) perhaps this version above is the best choice atm.
It looks really interesting, it's probably an option to change to that!
I've just tried the @rodhash' solution and it works very well! Like @carlosala said, to me it could be great if rupa/z
would be replaced by agkozak/zsh-z
.
Yeah, also cool that he reports to have native ZSH support, so, sounds a good deal to me .. if you wish I'd be happy to contribute w/ a PR ..
I just need to fix my PC, I messed up my grub so I'm dual booting to fix it
Oh grub issues... Good luck with that!
Yeah, I was experimenting with a new distro and something weird messed my grub in the process .. now it's good again.
So you guys think it's a good idea to replace z completely or just add the zsh-z (keeping z for whatever reason)? I haven't yet read the contributing.md, will check that out.
In my local repo I just added zsh-z and seems to be working fine (inside plugins and not custom/plugins).
@rodhash Both options looks good to me, but I prefer replacing z
completely, as one of its main functionality simply doesn't work and it's a tested and working alternative.
Could you test #10983 to check if it's working properly? You can do it with omz pr test 10983
.
it seems fine .. will keep it running as my daily driver Z till this PR is merged
I'm glad my Zsh-z plugin solves your problem. Let me know if you have any questions about it.
Hello, sir!
Awesome job! I'm happy oh-my-zsh folks accepted your plugin as a replacement for z :)
I'm glad my Zsh-z plugin solves your problem. Let me know if you have any questions about it.