Move by word using option+arrow

615 views
Skip to first unread message

Scott Graham

unread,
Dec 31, 2010, 11:19:57 AM12/31/10
to iterm2-discuss
Hi

I'm using bash. Can anyone suggest how to set up iTerm2 so that option
+left/right arrow will move backward/forward by words? (or control
+arrows would be fine too)

Thanks,
Scott

George Nachman

unread,
Dec 31, 2010, 12:30:22 PM12/31/10
to iterm2-...@googlegroups.com, iterm2-discuss
There's a bug in all builds of iTerm and iTerm2 that opt-arrow key does not send a different code than arrow key by itself. This has been fixed and will be in Monday's alpha 15.

Daniel

unread,
Dec 31, 2010, 12:32:59 PM12/31/10
to iterm2-...@googlegroups.com
*cheer* :)
--
"America was founded by men who understood that the threat of domestic tyranny is as great as any threat from abroad. If we want to be worthy of their legacy, we must resist the rush toward ever-increasing state control of our society. Otherwise, our own government will become a greater threat to our freedoms than any foreign terrorist."
 - Ron Paul, Texas Straight Talk, May 31, 2004

Scott Graham

unread,
Dec 31, 2010, 1:36:43 PM12/31/10
to iterm2-...@googlegroups.com
Excellent, I look forward to grabbing the new build.

Scott

Scott Graham

unread,
Jan 5, 2011, 8:23:55 PM1/5/11
to iterm2-...@googlegroups.com
Hi

Just trying this out... I'm still seeing ^[[D and ^[[C for opt+arrow
in 0.20.20110103.

I'm using the default xterm preset, is there something I need to
configure in Bookmarks->Keyboard to get word-move working?

Thanks,
scott

George Nachman

unread,
Jan 5, 2011, 8:28:04 PM1/5/11
to iterm2-...@googlegroups.com
Hm, I'm getting ^[^[[D and ^[^[[C, so there must be something in your config. Do you have Option Key acts as "+Esc" set? It won't do it for "Meta".

Scott Graham

unread,
Jan 5, 2011, 9:11:51 PM1/5/11
to iterm2-...@googlegroups.com
Thanks, that was most of the problem. Just for completeness:

In .inputrc:
"\e[D": backward-word
"\e[C": forward-word

In iTerm2:
- Left/Right Option Key acts as: +Esc
- Add mapping of opt-left to "send escape sequence" of "Esc+" + "[D"
- Similarly for opt-right, except "[C"

scott

George Nachman

unread,
Jan 5, 2011, 10:09:20 PM1/5/11
to iterm2-...@googlegroups.com
You shouldn't need to set the mappings for "send escape sequence", but I'm glad it's working. 
Reply all
Reply to author
Forward
0 new messages