zoxide: 'zoxide init --cmd cd bash' causing using cd to crash terminal
Hello,
just installed zoxide and I seem to be having difficulties with the --cmd flag. If i set the line in my bashrc to eval "$(zoxide init --cmd cd bash)"
then when I use cd it will hang for a minuite or so then either do nothing or crash the terminal.
Interestingly it only seems to happen when it is set to cd. Though setting it to ‘ls’ gives the following error message when I boot my terminal
bash: eval: line 130: syntax error near unexpected token `('
bash: eval: line 130: `ls() {'
setting it to other options seems to work fine (i.e. j
, test
) it seems for now a simple alias will work, but I’m certain the --cmd flag exist for a reason.
Am I missing something on how to set up or is this non-expected behavior?
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Reactions: 2
- Comments: 18 (3 by maintainers)
Debian / Ubuntu derivatives package a very old version of zoxide in their repositories. The latest version shouldn’t have this problem - could you try using the install script?
I had the same issue as mentioned by others when installing using Debian
apt
package manager :cd:1: maximum nested function level reached; increase FUNCNEST?
Installing
zoxide
using the installation script did the trick :curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
I also have this issue with ZSH
maximum nested function level reached; increase FUNCNEST?
Edit: I fixed this by replacing the
eval "$(zoxide init --cmd cd zsh)"
call in my .zshrc profile with a modified version of its output. The only thing I added is abuiltin
in front of thecd
command in the_z_cd
function.This is the output from
zoxide init --cmd cd zsh
with my modification:I’ve edited the README to strike out outdated package repositories to prevent future confusion. Thanks!