Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to disable the cmd + q hotkey for Terminal on OSX? and if so then how?

share|improve this question
add comment

2 Answers

You have two options:

  1. Assign a different shortcut that's not as prone to be hit accidentally.
  2. delete the existing shortcut

Option 1 can be accomplished in System Preferences » Keyboard » Keyboard Shortcuts » Application Shortcuts. As an example how option 1 looks like: alt text

alt text


Option 2 (removing the keyboard shortcut) requires the Terminal. Simply enter:

defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add "Quit Terminal" nil

Thanks @Arjan!

share|improve this answer
3  
defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add "Quit Terminal" nil removes the shortcut altogether. –  Arjan Dec 15 '10 at 20:06
    
@Arjan Is this documented somewhere? –  Daniel Beck Dec 15 '10 at 20:07
1  
I found it here: oreillynet.com//cs/user/view/cs_msg/46459 (there's a link to the main article, but it's the user comment that I learned this from.) –  Arjan Dec 15 '10 at 20:10
add comment

If you want to disable command-q because you're closing command-line programs accidentally, you can get Terminal to warn you before closing. Go into the Settings section of the Terminal -> Preferences... menu item and select the set up you use ("Basic" is the default). Then, under the shell tab is "Prompt before closing" - if you set this to "always", you'll be asked for confirmation if you hit command-q by accident. Alternatively, you can set a list of programs that won't interrupt you (mostly remote shells by default), while others will still cause a prompt.

share|improve this answer
    
Nice! Odd that things like ssh are listed as a default in "Prompt before closing". –  Arjan Dec 15 '10 at 22:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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