Some people like to live on the edge. Rather than bookmarking any sites they want to come back to (or adding them to their Reading List), they keep approximately 19 million tabs open in Safari. Then they freak out if anything they’ve “saved” gets accidentally closed, especially if Safari’s History > Reopen Last Closed Window or History > Reopen All Windows from Last Session menu options don’t help get anything back.
If you’re a chronic tab-keeping person, then it’ll be good for you to understand how Safari handles keeping its windows open between sessions. And this applies to a lot of other macOS apps, too, so if you’re confused about why Preview constantly brings back the PDFs you’ve looked at, for example, here’s how that works!
Keep All Windows When Closing an App
The first thing to know is that whether an app keeps its windows open when you quit it is controlled by a setting, which Apple’s programs (like Preview, Pages, and Safari) respect but some third-party apps (like Microsoft Word) do not. This is how you can see how your Mac is configured:
- Click on the Apple Menu at the upper-left corner of your screen and select System Preferences.
- Choose the General pane.
- Under that, look for the option labeled Close windows when quitting an app.
If that option is checked, then quitting a program (by pressing Command-Q or by choosing [Program name] > Quit from the menus at the top) will get rid of all of its windows; when you reopen it, it will start fresh.
If that setting is unchecked, then re-launching a compatible app will bring back everything you had open when you used it last, which is why your version of Preview may be showing you 17 old JPEGs every time it opens.
But here’s something cool: You can actually override whatever your default behavior is by holding down the Option key on your keyboard when you quit a program. If you have the aforementioned “Close windows when quitting an app” setting on, then holding down Option when you press Command-Q or when you choose [Program name] > Quit from the menus will switch that behavior to keeping the app’s windows open just for that one instance.
If instead you have “Close windows when quitting an app” off—meaning that all of your windows usually come back when apps are reopened—then holding down Option while you quit a program will force it to close everything that’s open just once.
Finally, there’s one more important tip with this. No matter how your Mac is configured, if you launch a program from the Dock while you’re holding down Shift on your keyboard, the app will be forced to discard all of its existing windows. This is helpful if, for example, Safari has opened a malicious site that’s causing it to crash repeatedly. Just force-quit the app if you need to, hold down Shift, and then click on the program in the Dock. It’ll come back all shiny and new, ready to visit malicious sites all over again.
I’m kidding, of course. Avoid those sites. Yes, even if they’re giving you really interesting downloads for free.
Want news and tips from TekRevue delivered directly to your inbox? Sign up for the TekRevue Weekly Digest using the box below. Get tips, reviews, news, and giveaways reserved exclusively for subscribers.