Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zi does not understand ~ #441

Open
Gorthog opened this issue Aug 15, 2022 · 7 comments
Open

zi does not understand ~ #441

Gorthog opened this issue Aug 15, 2022 · 7 comments

Comments

@Gorthog
Copy link

Gorthog commented Aug 15, 2022

image

z does
image

@ajeetdsouza
Copy link
Owner

@adamnejm this is not related to the current issue, can you create a separate issue for it? Also:

  • Can you verify that this is happening on the latest version of zoxide?
  • What version of fish are you using?
  • Can you post your configuration?

@jn64
Copy link

jn64 commented Nov 19, 2022

Can repro.

zoxide v0.8.2 (zoxide-0:0.8.2-1.fc36.x86_64)
bash 5.2.2
Fedora 36
Default config — no zoxide env vars are set, no options for zoxide init, just eval "$(/usr/bin/zoxide init bash)"


It's not about ~, that is expanded by the shell before it reaches zoxide.

zi fails on the user's home dir where z doesn't:

$ cd /tmp #to make sure it isn't about being in the same dir
$ zi ~
zoxide: no match found
$ zi "${HOME}"
zoxide: no match found
$ zi /home/jn
zoxide: no match found
$ z ~ #works

According to the README, _ZO_EXCLUDE_DIRS is set to $HOME by default, but I think it's reasonable for the user to expect zi to work the same as z in this case.

Testing that it's related to _ZO_EXCLUDE_DIRS:

  • Set _ZO_EXCLUDE_DIRS to blank value (or any other value) by adding to shell rc:
    export _ZO_EXCLUDE_DIRS=
  • Start new shell
  • Populate the db:
    $ zoxide add /home/jn
  • Now zi ~ works

@ajeetdsouza
Copy link
Owner

@Gorthog @jn64 why would you use zi ~ when you have z ~?

@jn64
Copy link

jn64 commented Nov 19, 2022

I wouldn't use either.

@Gorthog
Copy link
Author

Gorthog commented Nov 19, 2022

@ajeetdsouza I find zi behavior more efficient. when it has just a single match, it just jumps, when it has several matches, it shows me a list and i can choose. z just picks the first every time and it's not always what i want. i don't want to press space + tab every time, because when there is a single match there is no need for it

@memark
Copy link

memark commented Dec 11, 2022

@Gorthog @jn64 why would you use zi ~ when you have z ~?

@ajeetdsouza It sounds reasonable to me to use zi all the time if one likes the way it works, not having to mentally switch to z only in some cases.

@jn64
Copy link

jn64 commented Dec 12, 2022

Then un-exclude your home folder as explained above.

Anyway even z ~ is redundant. Just do z without arguments (like cd without arguments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants