Compensating for the Suckage of OS X Terminals

September 12, 2007

Every terminal in OS X that I’ve tried (Terminal.app, iTerm, Terminator) refuses to send a myriad array of valid keystroke combos over SSH. This wouldn’t be a problem except for the fact that I use Emacs, the Uber-Editor.One of these unsupported keystrokes is Control-Meta+any key (for those not fluent in Emacs, Meta is Alt); considering that this is one of the key commands in Emacs, the only alternative - pressing Escape to activate the Meta key, then entering the desired key command - is very inefficient and tends to interrupt the flow of typing. 
Until I can figure out the proper incantation to get Emacs to recognize a key as pressing Control-Meta, this shortcut will help with the inefficiency: 
(global-set-key "\C-c\C-v" 'ESC-prefix)
If anyone on the Lazyweb has any suggestions on how to fix this problem, please leave a comment. 

Entry Filed under: code. .

5 Comments Add your own

  • 1. Adam Sherman  |  September 13, 2007 at 1:02 pm

    Hi Patrick,

    Just thought I would let you know that my emacs works just fine, Meta key and everything. e.g. I can press Option-x and emacs shows M-x. If you are specifically talking about a combination like C-M-\, that seems to work for me as well.

    I then noticed that you mention ssh, so I tried that. Doesn’t work. WTF? Why would it work locally and not via a remote shell?

    Do you have any ideas?

    A.

  • 2. Antonio  |  September 17, 2007 at 11:19 pm

    Adam,

    Are you saying that you can:

    1) run Terminal.app out of the box
    2) within it, run a terminal-mode emacs
    3) and *then* have control+alt combinations work??

    That is (joyful) news to me! But this doesn’t work on my machine. What is your Terminal.app version? Did you fiddle with settings?

  • 3. Jeff  |  September 22, 2007 at 2:20 am

    In terminal.app, you can go to Terminal->window settings, then select keyboard, and there is a box that says ‘use alt as meta key’. This should work for Terminal.app, but sadly I have not found a way to get it to work for xemacs when using the GUI

  • 4. A vim user  |  November 7, 2007 at 1:42 pm

    Why C-c C-v? C-[ is the same as escape.

  • 5. k  |  May 30, 2008 at 4:31 pm

    This still doesn’t solve the problem for those users where the keyboard requires Option to make the following symbols:
    | ] [ \ { }
    ..all of which are used constantly in programming.

    Why Terminal.app doesn’t let you “use command as meta” is completely beyond me, and possibly the only major reason why I’m still not a real mac-fan.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


About Me



I'm a college freshman, passionate about technology, programming (especially Cocoa and Python), and Apple.

By the way, 'important shock' is an anagram for 'Patrick Thomson'.

Meta

Links

Categories

Top Posts

Blog Stats