How to Stop Accidentally Quitting Apps on Mac (Cmd+Q)
Q sits right next to W, so the shortcut that closes a tab is one slipped finger from the one that closes the whole browser. macOS lets you rebind any menu command per app — including Quit — so quitting can require a combo you'd never hit by accident.
Remap Quit to a harder combo
- Open System Settings → Keyboard → Keyboard Shortcuts…
- Select App Shortcuts in the sidebar and click +.
- Set Application to the app you keep killing — say, Safari.
- In Menu title, type the Quit command's name exactly as it appears in the app's own menu:
Quit Safari. - Click into Keyboard shortcut, press
Option+Cmd+Q(or any deliberate combo), and click Done.
Open the Safari menu to confirm: Quit Safari now shows your new combo, and plain Cmd+Q does nothing in that app. The remap works by matching the menu item's name, which is why it must be exact — capitalization included.
One catch: you can't do this once for every app using All Applications, because each app's quit item includes its own name (“Quit Safari”, “Quit Notes”…). Add an entry per app; in practice you only need two or three — the apps where losing state actually hurts.
To undo: back in App Shortcuts, select the entry and click −. The default Cmd+Q returns instantly.
Browsers have their own safety nets
- Chrome: open the Chrome menu and enable Warn Before Quitting (⌘Q). From then on you must hold
Cmd+Qfor a moment — a tap just shows “Hold ⌘Q to Quit”. - Firefox: in Settings → General, tick the option to confirm before quitting so a stray
Cmd+Qasks first. - Safari: no warn option, but it restores your windows on relaunch (see below), and History → Reopen All Windows from Last Session recovers a session you did lose.
Make an accidental quit cost nothing
The other half of the fix is letting macOS put everything back when a quit does slip through. In System Settings → Desktop & Dock, find Close windows when quitting an application and turn it off. With that off, quitting an app saves its window state, and reopening it restores every window exactly where it was — for most Apple apps and many third-party ones, an accidental Cmd+Q becomes a ten-second detour instead of a disaster.
Two more habits that help:
Cmd+Hhides an app instantly — same visual result as quitting, nothing lost. If your instinct is “get this out of my face”, hide, don't quit.- macOS itself asks for confirmation in some apps with unsaved documents — but browsers, chat apps, and anything “stateless-looking” usually just die. Don't rely on it.
The sneakiest quit of all: Q inside Cmd+Tab
One more way apps die mysteriously: while the Cmd+Tab app switcher is open — Cmd still held — pressing Q quits whichever app is highlighted. It's a deliberate feature (and genuinely useful for closing several apps in one sweep: keep Cmd held, Tab to each, tap Q), but if you didn't know it existed, it reads as apps randomly quitting “on their own” while you switch between them. If your Slack keeps being dead when you come back to it, this is probably why. The App Shortcuts remap above doesn't intercept this path, so the fix is simply knowing it's there — or exploiting it on purpose at the end of the day.
While you're accident-proofing your Mac, Mainspring turns 90+ hidden macOS settings into labelled, reversible toggles — window restore and Dock behavior included.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
Know what quitting actually does
Half of accidental-quit anxiety comes from not knowing the difference between the red button, Cmd+W, and Cmd+Q — see closing a window vs quitting an app on Mac. Spoiler: you probably quit apps more often than you need to.