ajeetdsouza / zoxide

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

Need to source bashrc everytime open in WSL #762

Closed byrocuy closed 6 months ago

byrocuy commented 6 months ago

Hello,

I am encountering an issue with zoxide in WSL. I have installed zoxide via install script, added zoxide in the ~/.bashrc, and using it fine after invoking zoxide init. However, when I close the terminal and reopen it, the z command was not found as I tried to use to navigate to a folder. Note that the zoxide command still works, but I have to source ~/.bashrc to be able to use z command again each time I open a new terminal.

I've explored some solutions on Stack Overflow, but none seems to work for me:

Note that I kept running zoxide: command not found after applying these steps and restarting the terminal.

Any insights or further suggestions for this problem?

Thank you

ajeetdsouza commented 6 months ago

The issue seems to be that zoxide is not in your PATH. If you've used the install script, you might want to add this line in your bashrc, before you call zoxide:

export PATH="$HOME/.local/bin:$PATH"
byrocuy commented 6 months ago

Wow, thanks man. It worked now. I thought that simply exporting the path directly in the terminal was sufficient 😅

ajeetdsouza commented 6 months ago

No problem!