Skip to content

Instantly share code, notes, and snippets.

@KEINOS
Last active September 27, 2023 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KEINOS/436a0ee5469232b122e42e76535cecad to your computer and use it in GitHub Desktop.
Save KEINOS/436a0ee5469232b122e42e76535cecad to your computer and use it in GitHub Desktop.
[macOS] Terminal app crashes right-away on start even in safe-mode

Question

I have a MacBookPro with Monterey (OSX 12.6.9) installed. When I start the terminal("Terminal.app" application), the application crashes right away. It even crashes in safe-mode boot of the OS. What can I do or check to solve this problem?

Answer

If Terminal.app is crashing immediately upon launch, it can be a frustrating issue to deal with.

Here are some steps you can take to troubleshoot and potentially resolve the problem. Try them from top to bottom:

  1. Reboot the OS:

    If the terminal suddenly crashed during operation, the very first thing you have to do is to save the data as much as possible. Then reboot the OS from the Apple Menu to clear the swap files and memory.

  2. Check for System Updates:

    Ensure that your macOS is up to date. Sometimes, Apple releases updates to fix issues like this. And sometimes, if the waiting updates are urgent, the OS locks some potential files for security reasons. Go to the Apple menu in the top-left corner, choose "About This Mac," and click on the "Software Update" button.

  3. Clear the saved terminal state:

    Applications saves its state. Terminal's app state data might be corrupted. You can try clearing it:

    • In Finder, go to your home folder (usually your username).
    • Press Command + Shift + . (the period key).
      This will show hidden files or folders, such as "Library". To hide them again press the same keys.
    • Navigate to Library/Saved Application State.
    • Find the folder named com.apple.Terminal.savedState and move it to the trash.
    • Clear the trash.
    • Restart Terminal.app.
  4. Reset Terminal Preferences:

    Terminal's preferences might be corrupted. You can try resetting them:

    • In Finder, go to your home folder (usually your username).
    • Press Command + Shift + . (the period key).
      This will show hidden files or folders, such as "Library". To hide them again press the same keys.
    • Navigate to Library/Preferences.
    • Find the file named com.apple.Terminal.plist and move it to the trash.
    • Clear the trash.
    • Restart Terminal.app.

    Note that this will clear all your terminal settings such as Fonts, etc.

  5. Check for Crash Logs:

    You can check for crash logs to get more information about why Terminal is crashing. Open the Console app (you can find it in the Utilities folder within Applications) and look in the "User Reports" or "Crash Reports" section. You might find crash reports related to Terminal.app. Look up the sections with "hread xx Crashed:: ... ". This can provide clues about the issue.

  6. Check for Third-Party Software Conflicts:

    Sometimes, third-party software or extensions can interfere with Terminal.app. Try booting your Mac into Safe Mode (restart and hold down the Shift key until you see the Apple logo) to see if Terminal works without any third-party software running. If it does, the issue may be caused by a third-party app or extension.

  7. Try Another User Account:

    Create a new user account on your Mac and see if Terminal works in that account. This can help determine if the issue is user-specific or system-wide.

  8. Reinstall macOS:

    If none of the above steps work, you may need to consider reinstalling macOS. Before doing this, ensure you have a backup of your important data.

  9. Contact Apple Support:

    If the problem persists and you can't find a solution on your own, it's a good idea to contact Apple Support or visit an Apple Store or authorized service provider. They can provide more specific guidance and assistance.

Note: Remember that some of these steps may require administrative access to your Mac, and making changes to system files or settings can potentially cause other issues, so proceed with caution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment