Is there a way to change/remove hot keys in Mac OS X 10.8.x's Terminal? Or prompt to be sure to quit

Discussion in 'Apple' started by Ant, Dec 30, 2013.

  1. Ant

    Ant Guest

    Hello.

    I keep pressing command and w (also q) hot keys by accident in Mac OS X
    10.8.x/Mountain Lion's Terminal when I meant to do that in my web
    browsers. Is there a way to change/remove them? Or at least ask me to
    confirm the quit/close at least?

    Thank you in advance.
    --
    Quote of the Week: "Individually, ants are stupid. Together, they're brilliant." --unknown
    /\___/\ Ant(Dude) @ http://antfarm.home.dhs.org (Personal Web Site)
    / /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
    | |o o| |
    \ _ / Please nuke ANT if replying by e-mail. If crediting,
    ( ) then please kindly use Ant nickname and AQFL URL/link.
     
    Ant, Dec 30, 2013
    #1
    1. Advertisements

  2. Ant

    Lewis Guest

    You can add/remove/change any¹ key assignment via System Preferences =>
    Keyboard => Shortcuts => App Shortcuts I would suggest changing them to
    ⌘⇧Q and ⌘⇧W.

    ¹ Perhaps nearly any.
     
    Lewis, Dec 30, 2013
    #2
    1. Advertisements

  3. Not with stock MacOS. Those command keys are part of the program. You
    used to be able to use ResEdit on a MacOS 9 application and tweak the
    Menu resource, but those days are gone.

    To assign or reassign keys requires a 3rd-party program to remap keys on
    a per program or global basis. There's iKey and Keyboard Maestro, either
    of which would map Command-W and Command-Q to do nothing or run a dialog
    box, then close the window or program if you click a button.

    The question is "Are you willing to train yourself to 'Don't do that' or
    will you spend money to fix the PEBKAC error.
     
    Michael Vilain, Dec 30, 2013
    #3
  4. Ant

    Lewis Guest

     
    Lewis, Dec 30, 2013
    #4
  5. Ant

    Guest Guest

    yes with stock mac os
    they are, but they can be easily overridden.
    true but there are new ways, namely system preferences/keyboard.
    there's no need for any third party app, although they may offer
    additional features.
     
    Guest, Dec 30, 2013
    #5
  6. Ant

    Your Name Guest

    You don't need a third party application. You can easily set and change
    keyboard shortcuts for most applications in the Keyboard System
    Preferences.

    Just add a new Application Keyboard Shortcut specifically for the
    Terminal application, type in the menu command "Quit Terminal", and
    then use a different shortcut - instead of Command-Q, you could use
    Control-Command-Q.
     
    Your Name, Dec 30, 2013
    #6
  7. One of the ones you can't do it for is Thoth; that probably applies to
    all carbon apps, but I haven't checked that out.
     
    Michelle Steiner, Dec 30, 2013
    #7
  8. Ant

    Ant Guest

    Well, I tried to be patient to learn to get used to it after a few
    years, but I still keep doing it. I have disabilities, so they don't
    help the situation. :(
    --
    "The general, unable to control his irritation, will launch his men to
    the assault like swarming ants, with the result that one-third of his
    men are slain, while the town still remains untaken. Such are the
    disastrous effects of a siege." --Chapter 3 in Sun Tzu's The Ancient Art
    of War (Translated by Lionel Giles)
    /\___/\ Ant(Dude) @ http://antfarm.ma.cx (Personal Web Site)
    / /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
    | |o o| |
    \ _ / If crediting, then use Ant nickname and AQFL URL/link.
    ( ) If e-mailing, then axe ANT from its address if needed.
    Ant is currently not listening to any songs on this computer.
     
    Ant, Dec 30, 2013
    #8
  9. Lots of answers to that question, but no one has (yet) answered this one:
    In Terminal preferences, go to the Settings tab and the Shell sub-tab,
    and change the "Prompt before closing" option.
     
    Barry Margolin, Dec 30, 2013
    #9
  10. Ant

    David Ritz Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

     
    David Ritz, Dec 30, 2013
    #10
  11. That's the first thing I checked, however it has no effect on closing
    the window or quitting the Terminal.app. Prompt before closing only
    affects whether or not a terminal window (or tab) closes, following
    logout.[/QUOTE]

    No, that's what the "When the shell exits" dropdown affects.

    I just changed the "Prompt before closing" option from "Never" to
    "Always", and then pressed Cmd-W. It popped up a confirmation dialog.
    He said it in the initial post: he thought he was in a Safari window,
    and was trying to close that. My guess is he just copied something from
    Safari to Terminal, so he no longer needed the browser window, and
    simply forgot to click back on that window to get rid of it.
     
    Barry Margolin, Dec 30, 2013
    #11
  12. Ant

    David Ritz Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

     
    David Ritz, Dec 30, 2013
    #12
  13. Ant

    Your Name Guest

    Not Safari specifically, but the original message said ...

    "when I meant to do that in my web browsers"
     
    Your Name, Dec 30, 2013
    #13
  14. Tiny mistake. He wrote "web browsers", he didn't specify the particular
    one. Is the distinction important in the context of this thread?
     
    Barry Margolin, Dec 30, 2013
    #14
  15. Ant

    gtr Guest

    It shouldn't be: The basic question is clearly applicable to the
    similar problem anywhere, should others with no *current* difficulty be
    following along.
     
    gtr, Dec 31, 2013
    #15
  16. Ant

    Ant Guest

    Cool. But how do you remove the hotkeys if I don't want to change them?
    --
    "Though your enemy is the size of an ant, look upon him as an elephant."
    --Danish
    /\___/\ Ant(Dude) @ http://antfarm.ma.cx (Personal Web Site)
    / /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
    | |o o| |
    \ _ / If crediting, then use Ant nickname and AQFL URL/link.
    ( ) If e-mailing, then axe ANT from its address if needed.
    Ant is currently not listening to any songs on this computer.
     
    Ant, Dec 31, 2013
    #16
  17. Ant

    Your Name Guest

    You can't. Just change it to something you'll never use (at least not
    accidentally) and isn't used in other applications:
    shift-command-control-option-Q
     
    Your Name, Dec 31, 2013
    #17
  18. Ant

    JF Mezei Guest

    re: preventing Command-W to close Terminal windows.

    There is a simple solution to this. And I believe it was succesfully
    used in the white house in January 2001: Remove the W key from the
    keyboard :)
     
    JF Mezei, Dec 31, 2013
    #18
  19. Ant

    Lewis Guest

    Hmm. I thought you defined the keybinding but left it empty, but that
    doesn’t seem to be working.

    Maybe the defaults write command, but I can't seem to find the syntax
    for that since it's been ages since I needed to use it now that the
    reassignment/assignment functionality is exposed in the GUI.

    Ah, wait, found it.

    defaults write -g NSUserKeyEquivalents

    (for a global shortcut)

    you can also set it for a single app

    defaults write -app Keynote NSUserKeyEquivalents -dict-add
    "Rehearse Slideshow" "@~R"

    You can also add multiple keyboard shortcuts at once:

    defaults write -app preview NSUserKeyEquivalents '{
    "Single Page" = "@1";
    "Two Pages" = "@2";
    "Continuous Scroll" = "@3";
    }'

    Of course, you will want to test all of these, it's been several
    versions of OS X since I used them and the syntax could have easily
    changed slightly. A good way to check syntax is to try defaults read
    first, since that is non-destructive.

    Way more information than [most] anyone would ever want:
    <http://www.hcs.harvard.edu/~jrus/site/Cocoa Text System.html>

    Also, this is useful (if slightly dated):
    <http://www.hcs.harvard.edu/~jrus/site/system-bindings.html>

    This is rather cool, and I did something like this way back in 10.2 or
    10.3 maybe with one application:

    defaults write com.some.app NSUserKeyEquivalents '{
    "^w " = {
    "w" = "close all windows:";
    "^w" = "close window:";
    };
    }'

    If I hit ^w twice, it closed the window, and if I hit ^w and then a
    regular w, it closed them all.

    I have no idea if that still works, though I am tempted to try it in
    Mail for a lark (since I never use ⌘W in mail...)

    --
    Footnote on the High Energy Magic building: It was here that the thaum,
    hitherto believed to be the smallest possible particle of magic, was
    successfully demonstrated to be made up of resons (lit: 'Thing-ies) or
    reality fragments. Currently research indicates that each reson is
    itself made up of a combination of at least five 'flavours', known as
    'up', 'down', 'sideways', 'sex appeal' and 'peppermint'.
     
    Lewis, Dec 31, 2013
    #19
  20. Ant

    Lewis Guest

     
    Lewis, Dec 31, 2013
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.