In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key
Try "export LANG=C". I'm not emacs expert, but I found this enables emacs on OS X to recognize the Option key as the Meta key in iTerm,
In Menu bar Iterm2 => Preferences => Profiles choose the keys tab and select
left Option key act as +Esc
worked for me as well in irssi.
It's easier in iTerm2. Go to preferences->bookmark->keyboard and select Option sends +ESC. In iTerm2 you can configure the left and right option keys separately, so remember to change both if that's what you want. Link for iTerm2: http://sites.google.com/site/iterm2home/
I found some solution on stackoverflow also, just go to keyboard profile and in "Global" change "Option key as" +ESC
that works for me perfectly =) btw some iterm patch exists also look here: http://www.emacswiki.org/emacs/EmacsForMacOS
Here is what worked for me: Bookmarks > Manage Profiles > Keyboard Profiles > Global/xterm > Option Key as +Esc. With this, I can use Option+Enter in Midnight Commander and the currently selected file/directory name shows up in the command string, as it should. Option Key as Meta did not work for me. My build of iTerm is 0.10.
I use iTerm2, and for me, this answer just partially solved my problem:
Cmd+, => Profiles => Keys and choose Left option Key acts as: +Esc.
In addition to that, I had to go to Cmd+, => Profiles => Keys and in the Key Mappings list find both Key Combinations: and , double click them and change their shortcuts to the following:
*Make sure to select Send Escape Sequence action.