How to Disable Command-Q to Stop it from Closing Your Apps on Your Mac

disable command q
Share the knowledge

It’s annoying as all get out – you’re just in the middle of something – whether it be composing an email, or a really great rebuttal online – and you go to hit Command+A to select all, or Command+W to close a tab, but you accidentally hit Command+Q (CMD-Q) instead, and lose it all in the blink of an eye. Argh! Here’s how to disable Command Q on your Mac to stop it from closing your programs.

There are a couple of different ways that you can disable Command Q on your Mac.

how to disable mac command q

 

You can do it natively, by remapping Command Q for (and only for) one given program at a time.

For example, to disable Command Q so that it doesn’t accidentally close your mail program, you would do this:

The Internet Patrol is completely free, and reader-supported. Your tips via CashApp, Venmo, or Paypal are appreciated! Receipts will come from ISIPP.

CashApp us Square Cash app link

Venmo us Venmo link

Paypal us Paypal link

Open Preferences

mac system preferences

 

Select Keyboard

mac system preferences keyboard

 

Go to the Shortcuts section, and click on App Shortcuts

mac preferences keyboard shortcuts

 

Click on the + sign to add a keyboard shortcut

add app keyboard shortcut mac

 

Click on the dropdown menu where it says ‘All Applications’. You’ll be tempted to try to remap Command Q for All Applications, but you can’t. You have to do it on an app by app basis.

disable command q on a mac in mail-1

 

On the dropdown, scroll down and select ‘Mail’

remap command q mac mail-1

 

In the Menu Title box, type a command found on one of the Mail menus. Type it exactly as it appears on the menu. For our example we picked ‘Reply’. Then go to the Keyboard Shortcut box and execute the key command sequence. For this example, you will hold down the Command key and the Q key, to tell your computer to remap Command Q to mean ‘Reply’ instead of ‘kill the app’.

remap command control cmd cntrl q so it doesnt quit mail

 

Then click on ‘Add’.

Now whenever you hit Command Q while in your Mail app, instead of quitting Mail, it will fire up a reply, which will remind you “You hit Command Q by accident, you dummy.”

BUT – it will only do this in the Mail app. If you want to do it for, say, your browser, you will have to go through those same steps all over again. Lather, rinse, repeat, for every single app that you want to protect from your accidentally quitting it.

OR

If you want to take care of that pesky Command Q problem once and for all (and we do mean all), you can download this nifty app that we found.

It’s called Karabiner, but before you go running off to download it, in your excitement at finally vanquishing Command Q universally, read on.

The most current version of Karabiner, for OS X 10.9 and later, uses something called Sparkle, and whether that was the problem or not, whenever we tried to install Karabiner on our test Mac, which is running a later version of OS X, it just hung during the install. We tried three different times, and it hung each time.

But when we downloaded the previous iteration of Karabiner, then known as KeyRemap4MacBook, for earlier versions of OS X (we downloaded the one for 10.6, 10.7, and 10.8) it installed and ran perfectly!

All of the versions are on one download page here.

Now, this program is a powerful program with a ton of options. So that you don’t get lost in the weeds, here is how to use it to disable Command Q:

The first thing you will want to do when you open the program is go to the bottom of the window and click “Close All”, because otherwise the dizzying array of options will make your eyes glaze over (unless you’re a hardcore geek, in which case it will make your heart go pitter-pat).

karabiner keyremap4macbook close all

 

Find the section called ‘Custom Shortcuts’

key remapping program for mac custom shortcuts command-q-1

 

In the Custom Shortcuts section, you will see three options for the Command+Q combination:

1. Change it (remap it) to Command+Shift+W (which closes a window instead of the whole app) and at the same time remap Command-Shift_L+Q to be Command+Q

2. Keep it as Command+Q but require a long-press (hold the keys down) for a certain period of time in order for it to take effect

3. Keep it as Command+Q but for it to work you have to do it twice

fix command q karabiner custom shortcuts

 

We chose the second option, because we don’t want to accidentally close a window either (option #1), and because we could see ourselves simply hitting it twice (option #3) because the Command+A that we thought we were hitting wasn’t working, so we would hit it again.

If you select the second option, as did we, you will need to then go to the Key Repeat section, and find the ‘Holding Key to Key’ section, to adjust the ‘holding threshold’ – in other words, how long of a long-press do you need – do you have to hold down that combination of Command+Q – in order to activate it?

karabiner remap command q key repeat

 

The time period is milliseconds (‘ms’), so 1000 represents one second. As we never want to use Command+Q here, we made the threshold nice and long: 5000 milliseconds, or 5 seconds.

karabiner holding threshold to disable command q

 

Of course, once you’re in the program, you may want to check out all of the other options (or, you may not). But now you know how to disable your Command+Q combination.

By the way, the creator of Karabiner, and KeyRemap4MacBook before it, Takayama Fumihiko, has made these available for free. On the Karabiner / KeyRemap4Macbook page, however, he does have a place where you can contribute a donation if you feel like it. We felt like it, and we hope that you will too. If this saves you from losing something through the accidental quitting of a program even once (and you know it will – or you probably wouldn’t have read this far), we think that it’s worth it.

Get New Internet Patrol Articles by Email!

The Internet Patrol is completely free, and reader-supported. Your tips via CashApp, Venmo, or Paypal are appreciated! Receipts will come from ISIPP.

CashApp us Square Cash app link

Venmo us Venmo link

Paypal us Paypal link

 


Share the knowledge

4 thoughts on “How to Disable Command-Q to Stop it from Closing Your Apps on Your Mac

  1. Command Q is not use full for School macs that the school provides witch when leaving the computer for 10 seconds wile the computer is closed up some on in the class comes up and commands Q all of your school work.

  2. Agreed. Command-Q is one of the most useful commands on a Mac, and I can’t remember hitting it by mistake.

  3. Why on Earth would anyone want to do this?

    – Command-Q is the Apple standard shortcut, system-wide. The only application I know that doesn’t use it is Carbon Emacs.

    – Attempting to quit an application that has unsaved data should, if the application is even remotely reasonably designed, alert you to save changes. If it doesn’t, it’s an application to avoid.

    Seriously — this is just plain wacko.

    1. Clearly you’ve never closed Safari with multiple windows and tabs open…….

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.