The Stealthy App Manager
macOS includes a deeply ingrained, often invisible feature known as “App Nap” or “Automatic Termination.” To preserve battery life and free up RAM, the operating system constantly monitors the applications you have running. If an application’s window is completely hidden behind other windows, and it is not actively playing audio or downloading a file, macOS might decide it is “inactive” and automatically terminate it without warning. While this keeps the system snappy, it is infuriating if you switch back to a reference document only to find the app was closed and you have lost your place, or if a background script was silently killed.
Disabling Automatic Termination
To ensure your background applications remain running exactly as you left them and stop macOS from automatically closing inactive windows, you must override this behavior. Note that Apple has removed the global toggle for this; it must be done per-app or via Terminal.
For a specific application, open Finder and navigate to your Applications folder. Right-click the specific app you want to protect and select Get Info. Look for a checkbox labelled Prevent App Nap and check it (Note: This checkbox is missing on many modern apps designed specifically for newer macOS versions). If the checkbox is missing, you must use the Terminal to set a global override, though it is advanced and less reliable on newer macOS versions. Open Terminal and type: defaults write NSGlobalDomain NSDisableAutomaticTermination -bool yes, then press Enter. You must restart your Mac for this global change to attempt to take effect.