Terminal quit unexpectedly every time

My terminal quit unexpectedly every time. I cannot open my terminal (terminal quit unexpectedly) after I updated my mcOS Ventura in software security update. My macOS version is macOS Ventura 13.4.1 (c) (22F770820d). My model is MacBook Pro M2 16'

Below is the terminal quit unexpectedly report





MacBook Pro 16″, macOS 13.4

Posted on Jul 18, 2023 05:48 PM

Reply
8 replies

Jul 20, 2023 08:34 AM in response to SerenAzuma

Yes, zsh is the now the default shell used by macOS Terminal. The switch has to do with GPLv3 licensing restrictions preventing Apple from using a newer version of bash.


It is not really necessary to install bash. There is already a copy on your system, HOWEVER, you need to be able to launch Terminal to run the command that switches from zsh to bash. BESIDES, I do not think it is zsh that is at fault. I think there is something else wrong with your macOS Terminal.


macOS Terminal should not be crashing.


The crash report says you have macOS Terminal 2.13, which is the same as is on my Ventura 13.4.1 (c) system.


The next thing to try is booting into Safe mode. Safe mode brings up a minimum macOS system, in some cases using more conservative drivers, and it does not load any 3rd party additions.

Boot macOS Safe Mode: Start up your Mac in safe mode - Apple Support


At this point, I would consider re-installing macOS Ventura OVER Top of the existing installation. As long as you do not erase your existing disk, the re-install will just replace the existing macOS operating system bit, including macOS Terminal, and will leave all your personal files alone.

How to reinstall macOS - Apple Support


Another approach is to try installing a different terminal emulator, such as iTerm2. This has 2 benefits. First, you would have a working terminal emulator and you could get on doing whatever you were planing to do. Second, assuming iTerm2 worked, then it would point to an issue with macOS Terminal, and not something they have in common, such as zsh (which I do not really think is at fault).

https://iterm2.com


Regardless of whether iTerm2 works on not, I strongly suspect you are going to need to try the macOS re-install. But iTerm2 might allow you to work in a terminal emulator doing your tasks, until you have time to do the re-install.


And if the re-install fails to correct the problem. The only idea I have left, is a Nuke & Pave. That is to say, backup your system, so all your personal files are safe. Maybe make 2 backups, using 2 different backup utilities, going to 2 different backup devices. This will make sure that a failure in software or hardware does not result in loosing any of your data.

Erase and reinstall macOS - Apple Support

During the initial setup after the re-install, when it asks if you want to transfer data from a backup or other system, point to one of your backups.


This is a measure of last resort. It should not be necessary, and if you can find anyway to avoid this, you should explore it.


Jul 18, 2023 06:04 PM in response to SerenAzuma

Delete the following file

~/Library/Preferences/com.apple.Terminal.plist


Finder -> Go (menu) -> Go to Folder -> ~/Library/Preferences


Delete com.apple.Terminal.plist


Now try to launch macOS Terminal


If that does not work, then look if you have any of these files in your home folder.


Finder -> Command-Shift-H

This will open your home folder


Finder -> Command-Shift-period

This will show invisible files. Repeat Command-Shift-period to again hide the invisible files.


While the invisible files are showing, look for and rename the following files:


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


  • .bash_profile
  • .bash_login
  • .profile
  • .bashrc


Some or maybe none of these files exist, but if they do, rename them to

  • save.zshrc
  • save.zprofile
  • save.zshenv
  • save.zlogin


  • save.bash_profile
  • save.bash_login
  • save.profile
  • save.bashrc


Now try to launch macOS Terminal

Jul 19, 2023 05:28 AM in response to SerenAzuma

Did deleting the com.apple.Terminal.plist file have any effect?


You are apparently configured to use the zsh shell, and it creates the session and history file & directory as soon as it runs when launching a macOS Terminal session.


The files I listed do not exist by default, and are created manually if and only if you the user wants to customize the shell’s behavior or you install a 3rd party command, program or utility that runs via a Terminal session.


The bash set would be for users that migrated from an older Mac before Apple switched from using the bash shell to using the zsh shell.

Jul 19, 2023 07:03 AM in response to BobHarris

Hi BobHarris,

Thank you again for your reply.

After I deleted com.apple.Terminal.plist, I still cannot open my terminal.

I did not configure my MacBook Pro m2, I guess that it use zsh initially when I buy it. I guess all new model of MacBook use zsh shell nowadays.

Could you suggest what should I do to solve the terminal problem?

For example, should I install bash? Thank you.

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.

Terminal quit unexpectedly every time

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