zoxide: no match found on startup
Closed this issue · 10 comments
I'm using a wsl ubuntu on a windows machine. when i first start up my wsl, the cd command doesn't seem to work?
In my .bashrc:
# z to jump around directories
export _ZO_ECHO=1
eval "$(zoxide init --cmd cd bash)"
Weirdly it works after i either source the bashrc again, when i run eval "$(zoxide init bash --cmd cd)"
manually, or when i remove the --cmd cd
. Why is this the case?
the cd command doesn't seem to work?
Can you elaborate?
P.S. you need cd to a directory the usual way at least once, so that zoxide can learn which directories you use.
This video might help: https://www.youtube.com/watch?v=aghxkpyRVDY
I am so sorry for the late reply..
I'm new to github and didn't know how to check notifications...
I did use cd at least once, my understanding is that using $(zoxide init bash --cmd cd)
aliases the z command with cd
but if I use this setup i can no longer use cd nor z?
Something is definitely wrong with your bashrc configuration. If you can share it here, I can take a look.
Thank you so much QAQ
bashrc.txt
I believe the ~/.bash_aliases file is empty so that shouldn't be the problem
- The same .bashrc file works for me (WSL + zoxide v0.9.4). Are you running a different version of zoxide?
zoxide -V
- Are you able to find the line that's causing the
--bash
error? You can find it by usingset -x
right at the top of your bashrc file (enables debugging). - What is the output of
type cd
?
You have 2 versions of zoxide installed on your system. I'm guessing you first installed it using sudo apt install zoxide
, and then ran the install script from the README after that.
To fix this:
sudo apt remove zoxide
In your .bashrc:
export PATH="$HOME/.local/bin:$PATH"
eval "$(zoxide init bash --cmd cd)"
That solved the issue. My god you are a genius!