ajeetdsouza / zoxide

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

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

Open Pmyl opened 5 months ago

Pmyl commented 5 months ago

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

birtles commented 5 months ago

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 ?

emirkmo commented 5 months ago

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)

nurkiewicz commented 4 months ago

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.

brutus commented 4 months ago

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).

lalitkapoor commented 2 months ago

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.

vasi786 commented 1 month ago

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.