Sometimes TAB completion inserts wrong directory
Reproducible with both zsh and bash
$z -l Cura
0.5 /Users/kent90/.virtualenvs/Cura
2 /Users/kent90/.virtualenvs/Cura/bin
344 /Users/kent90/Documents/Work/Ultimaker/Cura
$z Cura<TAB>
$z /Users/kent90
did you solve this?
ha!
no, I forgot about it.
But now that you mention it i have a pretty good idea of why that would happen, and if I'm right, it's a bug I need to fix.
great!, I switch to fasd that works fine, and the .z file is compatible :)
but I like that z is just a shell script that I don't have to install
Hi @rupa I'm also getting this behaviour, at least in zsh.
After inspection it seems the problem is that zsh "smartly" performs a partial completion if all completion suggestions start with the same prefix.
So actually, on my usage, since I mostly work inside /home/user/, completion is pretty useless as I always get /home/user/ on <TAB>.
I tried adding a echo '.' on the completion section and that solves it at the cost of always showing "." as first completion candidate. However, it also seems like zsh "sorts" the completion list alphabetically, so it's no longer ordered by frecency.
If this is indeed the problem, do you have any idea of how to address this?
EDIT: So it seems using setopt menucomplete prevents the partial completion effect. Though this command affects the current shell behavior and not just the present command/completion.
As for sorted output, it's supposed to be customizable using zstyle. Still trying to find the correct command...
Same here for bash I need to check it out.
I've also added the tab completion for z with fzf. Check it out: https://github.com/changyuheng/fz