3

There's an option in Terminal.app -> Preferences -> Settings -> Keyboard but it allows me only to set both option keys as meta keys. iTerm.app has such an option but don't like that application.

  • Would a solution that changed the system key mapping be acceptable? You could remap the right option key to do whatever else you choose, system wide. – bmike Aug 11 '11 at 13:58
  • That wouldn't help since I need the option key functionality. – blargh Aug 11 '11 at 14:15
  • If the programmers of Terminal app added this functionality - it's hidden with a preference you'd have to set manually in the plist. You're probably out of luck and will have to choose another program (have you looked at both iTerm and iTerm 2) - but it's a great question and logical need for people that want a meta key. Emacs user, by chance? – bmike Aug 11 '11 at 14:19
2

If you aren't totally set on using Terminal, I believe that iTerm2 has a setting to just use one of the option keys as meta. If you are, is there a setting to maybe use the Esc key as meta? I know that it's more convenient to use the option key, but the Esc key might be easier to set.

  • Yeah, I'm using the Esc key as meta key currently (I think it's set as meta key per default?) and hate it. It's not only hard to reach, but its function is also slightly different. For example: In irssi if you want to switch between channels you can keep alt pressed while choosing your channel via the number keys. Using Esc you'd have to press it every single time before pressing a number key. – blargh Aug 11 '11 at 14:33
  • Yeah, I only mention Esc because I've had better luck getting it to work with a few of the command line programs I use. – bringel Aug 11 '11 at 20:44
  • 1
    "Meta key" specifically refers to a modifier key, like Control, Shift, Option and Command. The Esc key is never "the Meta key". The Meta key can either cause an ESC to be written preceding the character you type or it can set the high bit of the character byte; however, modern terminals usually use UTF-8 or other encodings that require all eight bits, so usually the ESC prefix is used. Terminal only supports sending the ESC prefix. So, typing ESC before another character is simply sending the meta escape sequence to the tty and doesn't require configuration (at least, not in Terminal). – Chris Page Aug 12 '11 at 1:50
1

I have built a solution myself and it doesn't require abandoning Terminal.app in favour of iTerm 2.

It is a simple status bar app that runs in the background and rewrites all left Alt + $KEY key events to two key events in rapid succession, Esc, then $KEY; however, it only does this if Terminal.app is in focus.

You can find the source for the app here. You'll need Xcode to build it.

  • 1
    Please don't cross post this answer to multiple questions - question 1, question 2 and question 3. Instead, leave a comment and link back to it. – Allan Apr 5 '18 at 19:21
  • I did not have enough reputation to comment on the question. – habibalamin May 8 '18 at 18:55
  • It's a 6 year old question; it's not going anywhere. Earn some reputation points by asking/answering other questions which will unlock privileges. You can always come back and post a comment. – Allan May 8 '18 at 18:56
  • I'm not going to put in time and effort to jump through some arbitrary hoops just so I can answer someone's question, a question that I spent a long time myself trying to find a satisfactory answer for. If you want to delete my answer, then do so, otherwise, stop bothering me. Either way, I'm not going to leave my answer as a comment. – habibalamin May 9 '18 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .