Substitue Escape for Control U in Terminal I would like to change bash keybinding so that the Escape key has the same effect as Control U. For example, if I tap the Escape key, the current Terminal command will be cleared out (which is what Control U does). How can I specify both the Escape key and the Control modifier when writing a new key definition in my .bash_profile?
bind '"\e":"\C-u"' doesn't have any effect, and escape can't be remapped from Terminal's preferences.

iTerm 2 does allow remapping escape:



0x05 0x15 is C-e C-u. (E is 0x45 and U is 0x55.)

You could also use a private.xml like this with KeyRemap4MacBook:

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;appdef&gt;
    &lt;appname&gt;TERMINAL&lt;/appname&gt;
    &lt;equal&gt;com.apple.Terminal&lt;/equal&gt;
  &lt;/appdef&gt;
  &lt;item&gt;
    &lt;name&gt;test&lt;/name&gt;
    &lt;identifier&gt;test&lt;/identifier&gt;
    &lt;only&gt;TERMINAL&lt;/only&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::ESCAPE, ModifierFlag::NONE, KeyCode::E, ModifierFlag::CONTROL_L, KeyCode::U, ModifierFlag::CONTROL_L&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;


The last two options  would prevent using escape in for example vi though.