macOS terminal is not responding and cannot type commands

My macOS terminal is not responding and cannot type in any command after rewriting the nano file for the file or directory. I tried to rewrite the nano file as above shows.


# Conda initialization code...
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/XXX/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/XXX/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/XXX/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/XXX/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

# SDKman initialization code...
source "$HOME/.sdkman/bin/sdkman-init.sh"

--------------------------------------------------------------------------------------------------------------------------

However, I might do something wrong, once I opened a new terminal, it appeared like

--------------------------------------------------------------------------------------------------------------------------

I can type in commands but there is no response from it.

--------------------------------------------------------------------------------------------------------------------------

Whatever I type in, it keeps continuing like above.

--------------------------------------------------------------------------------------------------------------------------

I have tried to reset and terminated the terminal but nothing is working like it should be started with [name@Mac-Pro ~ %] to type in commands.

I know if there's a syntax error or incorrect modification in the shell initialization files, I can open the new terminal to check on the error, however, it's not allowing me to execute any command even though I force quit the old one and start a new terminal.

--------------------------------------------------------------------------------------------------------------------------

Please kindly help me with this, thank you so much!

MacBook Pro 13″

Posted on Jul 20, 2023 11:47 AM

Reply
1 reply

Jul 20, 2023 9:01 PM in response to em8500

em8500 wrote:

My macOS terminal is not responding and cannot type in any command after rewriting the nano file for the file or directory. I tried to rewrite the nano file



To make some progress before the experts jump in...

you can try open Terminal>Settings>General


and choose a default path, In an effort to open a new window , to trouble shoot your issue via Terminal


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

macOS terminal is not responding and cannot type commands

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.