Is there any way to have Safari 5 (OS X) ask before exiting? I have fat fingers and often hit Command-Q when I want Command-W.

4 Answers 4


In the tabs section of Safari's preferences, if you check the third option "Confirm before closing multiple tabs or windows", Safari will ask before exiting if you have more than one tab or window open. It won't ask for confirmation if you have only one open, but from what you're saying, that shouldn't be a major issue if you meant to close the window anyway.

  • Ahh! That's what I was looking for. I check all of the other preference tabs except that one :-).
    – Ralph
    Sep 23, 2010 at 18:42
  • 1
    I'm using OS X 10.8.3, Safari 6.0.3 and the "Confirm before closing multiple tabs or windows" option is not available
    – hanxue
    Sep 21, 2013 at 16:46
  • 4
    @hanxue I believe that option disappeared in the great iOS-ification of Mac OS X. The idea now is that Safari will by default restore all tabs and windows on re-opening. Alternatively, if you've turned this off by selecting the "Close windows when quitting an application" option in the "General" section of System Preferences, you can use the History -> Reopen All Windows from Last Session menu item to do this manually.
    – Scott
    Sep 21, 2013 at 21:46
  • 1
    @Scott Thank you for your quick follow up and detailed reply. I manage to solve it by remapping the Quit keyboard shortcut. Google Chrome handles the Quit issue better by having a "Warn before quitting" option. I commented for the benefit of anyone looking at this question in the future.
    – hanxue
    Sep 21, 2013 at 21:54
  • 1
    @Scott: I found your comment above useful enough that I turned it into an answer (with some extra details I found myself while looking into it). Thanks! May 4, 2018 at 11:25

I remap Safari’s Quit menu item shortcut to ⌥⌘Q (Option-Command-Q) using the “Keyboard Shortcuts” tab of the “Keyboard & Mouse” preference panel in System Preferences.


As Scott noted in a comment, modern macOS versions have a checkbox labeled "Close windows when quitting an app" in the "General" section of System Preferences:

Screenshot of "Close windows when quitting an app" System Preferences option on macOS
Unchecking that box will cause closed applications to remember their open windows and their content, and to reopen them when you restart the application.

Alternatively, if you prefer to enable this feature only for Safari, you can select "Safari opens with: All windows from last session" from the "General" tab in Safari preferences:

Screenshot of "Safari opens with: All windows from last session" preferences option
Note that this Safari-specific option is hidden when the general "Close windows when quitting an app" System Preferences option is unchecked, since it would be redundant in that case.

Also, as noted by Chris Johnsen, you can rebind the "Quit Safari" menu item to a different, less easily triggered keyboard shortcut (e.g. ⌥⌘Q) via System Preferences → Keyboard → Shortcuts → App Shortcuts:

Screenshot of how to change the "Quit Safari" keyboard shortcut in macOS System Preferences
Unfortunately, AFAIK there's no easy way to rebind the same shortcut for all apps, since the name of the menu item is obviously different for each app.

All screenshots taken and described behavior tested on macOS High Sierra version 10.13.4 with Safari 11.1. Obviously, later versions may change how things work.


Safari will prompt if you've edited a text field but not submitted the form yet.

Otherwise, you can get back to where you were after an accidental Quit by going to History > Reopen All Windows From Last Session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.