Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to initialize zoxide in my zsh #792

Open
moheladwy opened this issue Apr 19, 2024 · 2 comments
Open

Unable to initialize zoxide in my zsh #792

moheladwy opened this issue Apr 19, 2024 · 2 comments

Comments

@moheladwy
Copy link

I put this command eval "$(zoxide init zsh)" in my .zshrc at the bottom of the file as the README said,
When I open the terminal I got this error "(eval):51: parse error near `}" at the startup of the terminal,
I run the command and exported in an external file and then opened it, I found out that the problem with the function __zoxide_z(), the line 51 was the } at the end of the this function.

function __zoxide_z()  {
    # shellcheck disable=SC2199
    if [[ "$#" -eq 0 ]]; then
        __zoxide_cd ~
    elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
        __zoxide_cd "$1"
    else
        \builtin local result
        # shellcheck disable=SC2312
        result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" && __zoxide_cd "${result}"
    fi
}

i don't know what is the problem with this function actually. How can I solve this problem?

@ajeetdsouza
Copy link
Owner

What version of zsh are you using? You might need to upgrade it.

zsh --version

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label May 5, 2024
@moheladwy
Copy link
Author

moheladwy commented May 6, 2024

@ajeetdsouza The Version of the zsh on my system (arch-linux) is 5.9

image

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants