How can I bind only Left-Option to Meta/ESC in Terminal? I need Option for typing some special characters, so I cannot use Terminal.app’s “Use Option as Meta key” setting. But I cannot bear to do without an ESC-emitting Meta key either.

Eventually I got around to trying out iTerm2, and discovered that it allows one to choose to treat only one of the Option keys as a +ESC key (I chose the left one), which is absolutely perfect and exactly what I was after.

But I’ve basically spent all my time with it so far making it more like Terminal.app. Literally the only feature I like is the Left-Option binding; everything else it does differently from Terminal.app, I dislike.

And it’s ugly. From the icon on down.

So I wonder, is there any way I could teach Terminal.app this trick, to bind only one of the Option keys as Meta, so that I can ditch iTerm2?
There's probably a better way to do this, but you could try saving this as private.xml in KeyRemap4MacBook:

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
&lt;appdef&gt;
&lt;appname&gt;APPLETERMINAL&lt;/appname&gt;
&lt;equal&gt;com.apple.Terminal&lt;/equal&gt;
&lt;/appdef&gt;
&lt;item&gt;
&lt;name&gt;Terminal meta&lt;/name&gt;
&lt;identifier&gt;private.terminal-meta&lt;/identifier&gt;
&lt;only&gt;APPLETERMINAL&lt;/only&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::A, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::A&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::B, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::B&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::C, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::C&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::D, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::D&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::E, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::E&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::F, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::F&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::G, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::G&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::H, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::H&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::I, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::I&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::J, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::J&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::K, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::K&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::L, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::L&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::M, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::M&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::N, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::N&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::O, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::O&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::P, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::P&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::Q, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::Q&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::R, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::R&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::S, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::S&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::T, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::T&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::U, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::U&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::V, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::V&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::W, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::W&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::X, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::X&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::Y, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::Y&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::Z, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::Z&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_0, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_0&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_1, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_1&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_2, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_2&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_3, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_3&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_4, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_4&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_5, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_5&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_6, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_6&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_7, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_7&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_8, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_8&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEY_9, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEY_9&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::BACKQUOTE, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::BACKQUOTE&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::BACKSLASH, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::BACKSLASH&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::BRACKET_LEFT, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::BRACKET_LEFT&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::BRACKET_RIGHT, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::BRACKET_RIGHT&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::COMMA, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::COMMA&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::DOT, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::DOT&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::EQUAL, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::EQUAL&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::MINUS, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::MINUS&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::QUOTE, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::QUOTE&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::SEMICOLON, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::SEMICOLON&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::SLASH, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::SLASH&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_0, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_0&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_1, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_1&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_2, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_2&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_3, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_3&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_4, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_4&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_5, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_5&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_6, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_6&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_7, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_7&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_8, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_8&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_9, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_9&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_CLEAR, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_CLEAR&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_COMMA, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_COMMA&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_DOT, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_DOT&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_EQUAL, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_EQUAL&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_MINUS, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_MINUS&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_MULTIPLY, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_MULTIPLY&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_PLUS, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_PLUS&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::KEYPAD_SLASH, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::KEYPAD_SLASH&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::DELETE, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::DELETE&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::ENTER, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::ENTER&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::ESCAPE, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::ESCAPE&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::FORWARD_DELETE, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::FORWARD_DELETE&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::RETURN, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::RETURN&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::SPACE, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::SPACE&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::TAB, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::TAB&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::CURSOR_UP, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::CURSOR_UP&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::CURSOR_DOWN, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::CURSOR_DOWN&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::CURSOR_LEFT&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::CURSOR_RIGHT&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::PAGEUP, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::PAGEUP&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::PAGEDOWN, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::PAGEDOWN&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::HOME, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::HOME&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::END, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::END&lt;/autogen&gt;
&lt;autogen&gt;__KeyToKey__ KeyCode::UK_SECTION, ModifierFlag::OPTION_L, KeyCode::ESCAPE, KeyCode::UK_SECTION&lt;/autogen&gt;
&lt;/item&gt;
&lt;/root&gt;


This wouldn't work with repeated key presses:

__KeyToKey__ KeyCode::OPTION_L, KeyCode::VK_NONE, Option::KEYTOKEY_BEFORE_KEYDOWN, KeyCode::ESCAPE