ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
20.54k stars 523 forks source link

Issue with <space>+<tab> #714

Closed odakaui closed 4 months ago

odakaui commented 4 months ago

Hi,

distro: 6.7.5-arch1-1 shell: zsh 5.9 zoxide: zoxide-0.9.2-1 (I tried 0.9.3 using the install script, but ended with the same result)

I'm having an issue with getting space+tab to work. It works properly and calls up fzf the first time I log in, open up a new terminal, or after I use space+tab on a different folder. But, it doesn't work when I try to use space+tab on the same folder twice in a row.

Subsequent runs of zoxide do not call up fzf. Instead, it immediately prints out a folder and subsequent presses of tab print zoxide: no match found.

$ z bin 'z#/usr/local/bin'
$ z bin 'z#/usr/local/bin/' zoxide: no match found

The following commands are placed at the end of my .zshrc file.

autoload -Uz compinit
compinit -i

# setup zoxide
export _ZO_ECHO=1
eval "$(zoxide init zsh)"

I tried installing zoxide on a fresh arch install, and the same thing happened. I tried running in both the linux console and foot with the same results.

Is this expected behavior? Or, is there something wrong with my setup?

Thank you for your time!

ajeetdsouza commented 4 months ago

I've just released zoxide 0.9.4, could you see if this fixes your issue?

odakaui commented 4 months ago

Hi, Thank you for your response.

Unfortunately, 0.9.4 does not solve my problem. It does properly remove the old path before filling in the new path, but it only brings up fzf on the first call. Using a different string to call up fzf seems to reset this.

$ z bin <space>+<tab> [fzf choose /usr/local/bin] (now properly replaces 'bin' with '/usr/local/bin')
$ z bin <space>+<tab> (immediately replaces 'bin' with the second option in fzf '/home/[username]/.local/bin')
$ z log <space>+<tab> [fzf choose /var/log] (replaces 'log' with '/var/log')
$ z bin <space>+<tab> [brings up fzf properly]

Thank you for your time!

ajeetdsouza commented 4 months ago

That's expected behaviour, it happens because the current directory is excluded from the list of suggestions. I'll make the error message clearer.

odakaui commented 4 months ago

Ah. Ok. Thank you so much for your help!