Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal is unable to quit /Cant install Homebrew

I have tried to install Homebrew last night to get started with some coding. After pasting in the command from brew.sh it ran for about 45 minutes. It then said it was complete and I had to enter 2 commands (I don't remember which ones) to give it some permissions. I entered the commands and then Terminal stopped working.

I couldn't enter any commands, it just says "Last login: Mon Feb 7 09:49:59 on ttys000". (Date changes whenever I quit, but that also doesn't really work, it says "closing this window will terminate the running process cat". Even if I press "terminate" and then reopen Terminal it is still not working.


I have tried force-quitting, wiping as many files as I could, I am trying to update my mac to Monterey, I have restarted and shut down twice each and I have no idea how to either fix the problem or completely stop the entire thing and then retry installing brew.


Please help Ive been stuck on this for more than an actual full day...

Posted on Feb 7, 2022 1:07 AM

Reply
Question marked as Best reply

Posted on Feb 7, 2022 11:58 AM

Your shell script login is messed up somewhere, as something is invoking the cat command to display the contents of some file.


Launch Finder, and go to your home directory if not already there, then press Command-Shift-Period (⌘⇧.) to toggle the hidden-file display setting. With hidden files viewable, look for and rename (.zlogin to .zlogin-save or whatever) any of the following list of files found there:

  • .zlogin
  • .zlogout
  • .zprofile
  • .zshenv
  • .zshrc


Above assumes your login shell is zsh, and not bash. (System Preferences ? Users & Groups > Click the padlock and authenticate > Control-Click on your username at the top of the left column and select Advanced Options from the popup menu. Make no changes here, just check that your login shell is /bin/zsh and not not /bin/bash. If this is that bash you're still using, post back and I'll post the bash shell equivalents to the above zsh files.


Then you get to untangle whatever happened here with Homebrew.


When trying to resolve this, it would have been better to revert to a Time Machine backup immediately prior to the Homebrew issue rather than to move forward with upgrades, but we are where we are.

Similar questions

1 reply
Question marked as Best reply

Feb 7, 2022 11:58 AM in response to iBoyMinecraft

Your shell script login is messed up somewhere, as something is invoking the cat command to display the contents of some file.


Launch Finder, and go to your home directory if not already there, then press Command-Shift-Period (⌘⇧.) to toggle the hidden-file display setting. With hidden files viewable, look for and rename (.zlogin to .zlogin-save or whatever) any of the following list of files found there:

  • .zlogin
  • .zlogout
  • .zprofile
  • .zshenv
  • .zshrc


Above assumes your login shell is zsh, and not bash. (System Preferences ? Users & Groups > Click the padlock and authenticate > Control-Click on your username at the top of the left column and select Advanced Options from the popup menu. Make no changes here, just check that your login shell is /bin/zsh and not not /bin/bash. If this is that bash you're still using, post back and I'll post the bash shell equivalents to the above zsh files.


Then you get to untangle whatever happened here with Homebrew.


When trying to resolve this, it would have been better to revert to a Time Machine backup immediately prior to the Homebrew issue rather than to move forward with upgrades, but we are where we are.

Terminal is unable to quit /Cant install Homebrew

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