confusion about the result of "which conda" in zsh

Viewed 84

When I input this command in zsh:

which conda

It returns

conda () {
        \local cmd="${1-__missing__}"
        case "$cmd" in
                (activate | deactivate) __conda_activate "$@" ;;
                (install | update | upgrade | remove | uninstall) __conda_exe "$@" || \return
                        __conda_reactivate ;;
                (*) __conda_exe "$@" ;;
        esac
}

But I hope it returns the absolute path as it behaves in bash.

When I input:

type conda

It returns

conda is a shell function from /Users/qxchen/.zshrc

Actually, there is no function in .zshrc named by conda

I delete the script in .zshrc which is made by "conda init zsh", and then I add the absolute path of miniconda/bin to PATH.

But in bash, "which conda" returns the absolute path of "conda".

/Users/ABC/miniforge3/condabin/conda

And the result of "type conda":

conda is a function
conda () 
{ 
    \local cmd="${1-__missing__}";
    case "$cmd" in 
        activate | deactivate)
            __conda_activate "$@"
        ;;
        install | update | upgrade | remove | uninstall)
            __conda_exe "$@" || \return;
            __conda_reactivate
        ;;
        *)
            __conda_exe "$@"
        ;;
    esac
}

I want zsh to behave like bash at this point, aka "which conda" should return the path of conda, and "type conda" should return its real type.

What should I do?

Thanks for your help in advance.

0 Answers
Related