Skip to Content
Back to Supercharge

Updated

How to Stop Command+W from Closing Windows by Accident on Mac

A wrong CommandW is worst in an app where the window is the work, like a web app that you added to the Dock from Safari.

With Supercharge

  1. Open Supercharge, and give it the access that it asks for in “Device Control and Data Access”.
  2. Open the Supercharge settings, and click “Tweaks”.
  3. In the “Apps & Windows” section, find the setting that prevents accidental CommandW window closing, and choose one of these:
    • Press and hold CommandW.
    • Hold Command and press W twice.
    • Press ShiftCommandW.
  4. Choose the apps that it applies to, with the button below the menu. It does nothing until you choose an app.

Then a single press of CommandW does nothing in these apps, and the way you chose closes the window. In all other apps, CommandW works as before. To also stop CommandQ, see how to stop Command+Q from quitting apps by accident.

Get Supercharge

Elevate your Mac experience

$20, one-time purchase, plus tax where applicable

Platform
macOS
Requires
macOS 26.4 or later
Released
September 2024
Updated
September 2026
Version
1.30.1
Size
16 MB
Gumroad rating
5.0/5 (284 ratings)

More about Supercharge

Without an app

macOS has no setting for this, but you can give the Close command of one app another shortcut, so CommandW does nothing in that app:

  1. Open “System Settings › Keyboard”, and click “Keyboard Shortcuts…”.
  2. Click “App Shortcuts”, and click the add button.
  3. Choose the app, and type the name of its command that closes the window, exactly like in the menu of the app.
  4. Click “Keyboard shortcut”, press the new shortcut, and click “Done”.

This is free, and it is enough for one or two apps. The name of the command is different between apps, and you must learn a new shortcut for each. With Supercharge, the keys stay the same, and only a longer press or a second press is needed.