ajeetdsouza / zoxide

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

tmux can't find zoxide #749

Closed majinaru closed 6 months ago

majinaru commented 6 months ago

After installing zoxide I tried to run tmux and for some reason this happens: (first pic is my normal terminal working fine. Int the second one, tmux is running and can't find zoxide)

image

image

I'm using zsh, but it also occurs in bash.

ajeetdsouza commented 6 months ago

What's the output of echo $PATH in both cases?

majinaru commented 6 months ago

terminal: /home/joao/.cargo/bin:/home/joao/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/joao/.fzf/bin

tmux: /home/joao/.nvm/versions/node/v21.7.0/bin:/home/joao/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/joao/.fzf/bin

ajeetdsouza commented 6 months ago

Linux looks for executables (like zoxide) in $PATH - in the first case, I can see /home/joao/.local/bin is present, but it isn't there in the second case. Something is overriding your PATH here.

If you can't find what is overriding your PATH, I would add this line just before the eval statement that initializes zoxide:

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

Thank you, it worked!