zoxide
zoxide copied to clipboard
zi does not understand ~

z does

@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?
@ajeetdsouza It was in fact stupid misconfiguration on my part. I accidentally swapped places of sourcing zoxide and cd alias definition.
This is not an issue nor related to this thread in any way, so I removed my previous comment. Sorry!
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_DIRSto 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
@Gorthog @jn64 why would you use zi ~ when you have z ~?
I wouldn't use either.
@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
@Gorthog @jn64 why would you use
zi ~when you havez ~?
@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.
Then un-exclude your home folder as explained above.
Anyway even z ~ is redundant. Just do z without arguments (like cd without arguments).