How to Stop macOS from Automatically Closing Applications

The Sudden Termination

macOS employs aggressive memory management to ensure the system remains responsive, even on MacBooks with limited RAM. One of the ways it achieves this is through a largely invisible feature called “Automatic Termination.” If you have a supported application open, but you haven’t interacted with it for a long time, and you close all of its visible windows, macOS might silently quit the application entirely in the background to free up memory. While efficient, this is incredibly annoying if you expect an app (like a chat client or a specific utility) to remain instantly accessible in the Dock without enduring a full launch cycle when you click its icon again.

Overriding the Memory Manager

To ensure your apps stay running exactly as you left them and stop macOS from automatically closing inactive applications, you must disable the global Sudden Termination feature.

Because Apple removed the easy toggle for this setting in older OS versions, you must use the Terminal to override the default behavior system-wide. Open the Terminal app (press Command+Space, type Terminal, hit Enter). You need to write a hidden preference to the global domain. Carefully type the following command exactly as written: defaults write -g NSDisableAutomaticTermination -bool yes and press Enter. The command will execute silently without output. You must restart your Mac for this change to fully take effect across all applications. After the reboot, macOS will no longer quietly kill your background apps just because their windows are closed.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.