Meta-key in terminal

I am using a Macbook with a norwegian keyboard. The keyboard doesn't have
symbols such as | or ~, so I have to use the Option key to produce them.

In terminals, I have the ability to set Option to behave as a meta-key which gives
me the full functionality of Emacs as well as meta-key combinations on the shell
(e.g. Option + d to delete a word in a line of text). However, when I enable the
Option-key as Meta-key, I cannot use Option key to produce e.g. | or ~.

What I would like is a way to set another key as Meta-key... Caps lock would be
nice, since I never really use it. I have tried DoubleCommand, fKeys etc, but none
of these applications allow me to set a Meta-key. Is there a way to force this behaviour?

Macbook, Mac OS X (10.5.4)

Posted on Sep 5, 2008 4:29 AM

Reply
7 replies

Sep 10, 2008 2:54 AM in response to Dag Henrik

Hi there,

I had the same question and by googling some more I found a page that indicated that the meta key is, by default, the ESC key, and the terminal allows you to change that into the OPTION key. So, uncheck the checkbox that sets OPTION as meta key, and you'll have ESC as meta-key.
This solves my problem (typing ~ and @ in terminal), hopefully yours as well.

Regards,

Alessandro

Nov 18, 2008 11:49 AM in response to liyanage

liyanage wrote:
Please let us know if you figure this out. I have been looking for a solution to this for years.

It doesn’t seem to be a problem for Mac users who use the US layout because they can get by without the Option key in Terminal. But I use the Swiss German layout, and giving up the Option key is not possible because I can’t even type the @ without it on this layout.

It would be really great if somebody figured out how to assign this Meta functionality to caps lock, or the Fn key. I would also appreciate a technical description what this checkbox in the Terminal settings actually does. Then maybe I could find a workaround. Does it send a special sequence to the shell?


You just got your answer.
For more information use the Unix forum, here:
http://discussions.apple.com/forum.jspa?forumID=735

Nov 18, 2008 3:24 PM in response to orangekay

Ah you mean the ESC key posting? That's what I've been using all these years as a workaround, but that is not a real solution.

The ESC solution is different and more awkward to type than a real meta key. For one it is in an inconvenient location, and more importantly it's not used like a modifier key because you have to press and release it before typing the combination character. So instead of pressing and holding Meta, then typing the dot key, then releasing both (to get the last argument of the previous command line in bash for example), I have to press ESC, then release ESC and then type the dot. If I don’t do that, and hold the ESC key down, the repetition kicks in and that breaks key sequences.

But I really want to press and hold meta, press the dot, and then release them both at once. Exactly like the combinations that you use with the Ctrl key, or the Mac keyboard commands you use with the Command key. I want to use the meta key like the Ctrl key, which is the natural way to use it. The ESC fallback is a less convenient substitute which we’re forced to use, unfortunately... But I hate it.

So, if you know of a way to assign the meta role to some key other than the Option key in a way that allows me to use it like a real modifier key that can be held pressed without going into repetition, then that would be the solution I am looking for. And I guess the “other key” can pretty much only be Caps Lock or Fn.

Nov 18, 2008 11:35 AM in response to Dag Henrik

Please let us know if you figure this out. I have been looking for a solution to this for years.

It doesn’t seem to be a problem for Mac users who use the US layout because they can get by without the Option key in Terminal. But I use the Swiss German layout, and giving up the Option key is not possible because I can’t even type the @ without it on this layout.

It would be really great if somebody figured out how to assign this Meta functionality to caps lock, or the Fn key. I would also appreciate a technical description what this checkbox in the Terminal settings actually does. Then maybe I could find a workaround. Does it send a special sequence to the shell?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Meta-key in terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.