OS X Terminal keystroke shortcuts

Discussion in 'MacBytes.com News Discussion' started by MacBytes, Sep 28, 2005.

  1. MacBytes macrumors bot

    Jul 5, 2003
  2. SpinUp macrumors newbie


    Nov 29, 2004

    I will hereby use ctrl-A and ctrl-E to go to the end and beginning of a line. Thanks for the tip!
  3. iMeowbot macrumors G3


    Aug 30, 2003
    There are more shortcuts in there that might be nice to know about if you spend a lot of time in bash.

    To see a list of what's available, you can use the command bind -p | less If you're not familiar with emacs conventions, \M means to press esc, \C means the control key.

    If you're one of those hopeless sorts who think that vi is a good thing, set -o vi will give you your familiar, inferior key bindings. set -o emacs will put things right when you come to your senses.
  4. AlmostThere macrumors 6502a

    You can also do a Xwindows-type highlight and paste in the Terminal (highlight any text and then middle click to put paste it to the command line). Note, this is NOT stored to clipboard (i.e. only works when text is highlighted).

    But, what would be really nice to know, and something I hoped the article would address, is why half of these work in any TextField but half don't (i.e. the Esc based ones generally don't). Try Ctrl-U or Ctrl-K in the address bar in Safari, or the submission box.

    Anyone know how to get the full functionality in all text fields?

    (OK, prompted a google which turned up this http://www.gnufoo.org/macosx/macosx.html, which am currently investigated)
  5. angelwatt Moderator emeritus


    Aug 16, 2005
    Well I'd say it is in part becuase of the Unix backside stuff. I know when I use the pico editor in telnet sessions the same ctrl+key commands are the same as the ones this page showed. I never tried any esc+key type shortcuts. I often forget I have an esc key. As far as some of the commands working in text fields I would assume it has something to do with Apple's Human Interface Design Guidelines that may automatically carry over certain abilities like the ctrl+key shortcuts. It could also be programmer dependent and you only get those abilities if the programmer decides to put them their.

    I haven't yet done any GUI programming for Mac so only speculating, but hey it sounds logical right? lol
  6. Santaduck macrumors 6502a


    Oct 21, 2003
    ahhh, that was what I was going to add too, esp. in this era of the Mighty Mouse.
  7. nagromme macrumors G5


    May 2, 2002
  8. sjk macrumors 6502a

    May 2, 2003
    Last week I wrote a few comments related to this topic in a MacOSXHints thread. If anyone's interested, search there for sjk or the comments titled:

    Emacs-style key bindings (with a working link to Apple dev page that's broken on the gnufoo site)
    key bindings vs. accesskeys (my nit about the control key prefix conflict)
    vi vs. emacs bindings (iMeowbot might appreciate that :))

    Yep. User-redefinable key bindings are part of Cocoa's text system.

Share This Page