zoxide icon indicating copy to clipboard operation
zoxide copied to clipboard

z foo<SPACE><TAB> says no match found but zi show matching directories

Open Pmyl opened this issue 1 year ago • 8 comments

Hello, I just installed zoxide and fzf but I can't make it work as it should.

Using z foo works great Using zi works great Using z foo<SPACE><TAB> has very weird behaviours.

Let's say the content of zi is:

/media/pmyl/big/projects
/media/pmyl/big

This happens

z media<SPACE><TAB>
Executes (with new shell prompt): z media zoxide: no match found

z big<SPACE><TAB>
Autocompletes: z big z!/media/pmyl/big

z projects<SPACE><TAB>
Autocompletes z big z!/media/pmyl/big/projects

Am I doing anything wrong?

If that matters, the examples above use z for simplicity but I've configured it to replace cd through zoxide init --cmd cd fish | source.

I use these versions, all installed through homebrew: zoxide 0.9.3 fzf 0.46.1 fish 3.7.0

Pmyl avatar Feb 14 '24 22:02 Pmyl

I see the same behavior and have the exact same versions of zoxide, fzf, and fish so I wonder if this is a fish-specific issue, perhaps stemming from this changeset: https://github.com/ajeetdsouza/zoxide/commit/0b51cb659165eb619a19ca35831f7c3d95d649ad ?

birtles avatar Feb 17 '24 03:02 birtles

I have the same issue on zsh, and it works if I use __zoxide_cd instead of my cd alias __zoxide_cd home<space><tab> works fine. cd home<space><tab>: zoxide: no match found


zoxide --version: 0.9.3 fzf --version: 0.29 (devel)

emirkmo avatar Feb 18 '24 15:02 emirkmo

I get the same behavior on zsh with oh-my-zsh:

zoxide --version
$ zoxide 0.9.3

$ fzf --version
0.42.0 (brew)

U have this alias set up:

$ which cd
cd: aliased to z

zi works.

nurkiewicz avatar Feb 19 '24 14:02 nurkiewicz

Seems I have the same issue…

❯ cat /etc/fedora-release 
Fedora release 39 (Thirty Nine)

❯ fish --version
fish, version 3.7.0

❯ zoxide --version
zoxide 0.9.2

❯ fzf --version
0.44.1 (Fedora)

❯ type cd
cd is a function with definition
# Defined via `source`
function cd --wraps=__zoxide_z --description 'alias cd=__zoxide_z'
  __zoxide_z $argv
end

Works as expected until I <space><tab>. Which seems fine at first too, menu shown and all, but turns the result into z!<result>, e.g.

❯ cd tmp z!/tmp

NOTE: cdi works fine.

UPDATE: just noticed b/c it broke ALT+C support of fzf (works again after a functions --erase cd).

brutus avatar Mar 06 '24 18:03 brutus

I get tab completions in fish if I don't change the cmd to cd on init via init --cmd cd and just use z. It would be great to get it to autocomplete when replace cd.

lalitkapoor avatar Apr 26 '24 03:04 lalitkapoor

Same issue, but on bash, I do not have interactive fuzzy finding when I do space+tab

NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" .bashrc eval "$(zoxide init --cmd cd bash)" export _ZO_ECHO='1' export _ZO_DATA_DIR='/home/$USER/.local/share/zoxide/' export _ZO_MAXAGE=10000 zoxide --version zoxide 0.9.4 bash --version GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

fzf --version 0.52.1

and which cd gives me /usr/bin/cd, but when I do type cd, I get cd is a function cd () { __zoxide_z "$@" }

The echo of the path doesn't work when I have --cmd cd, but it works without it. Also, without --cmd cd, the interactive fuzzy finding is absent.

vasi786 avatar Jun 01 '24 10:06 vasi786

similar issue, typing z a<space><tab> results in the following (note, anything inbetween <> is something I pressed)

$ <z a><space><tab>

# shows fzf menu as expected
<enter>
# shows an empty fzf menu, the input field has 0n written in it
<enter>
zoxide: no match found # menu still shows, input field is still 0n, terminal is not responding to mouse input
<enter>
$ z a # I didn't type this, it's showing at a new shell prompt, the previous prompt is empty
<enter>
# the expected result of running z a occures, not whichever item I picked from the fzf menu

note that I have z and zi defined as z() { __zoxide_z "$@" && lsd; }; zi() {__zoxide_zi "$@" && lsd; }, removing those lines from my zshrc has no effect, I still face that issue

4rtemis-4rrow avatar Aug 07 '24 12:08 4rtemis-4rrow