MainspringGuides › Cmd+Q accidents
macOS Guide

How to Stop Accidentally Quitting Apps on Mac (Cmd+Q)

Updated August 2026 · 3 min read

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

  1. Open System SettingsKeyboardKeyboard Shortcuts…
  2. Select App Shortcuts in the sidebar and click +.
  3. Set Application to the app you keep killing — say, Safari.
  4. In Menu title, type the Quit command's name exactly as it appears in the app's own menu: Quit Safari.
  5. 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

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:

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.

Guardrails in one click

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.