word-skipping

173 views
Skip to first unread message

Joe

unread,
Apr 10, 2011, 7:52:15 PM4/10/11
to iterm2-discuss
Hi,

I'm new to iTerm2 and am trying to figure out how to get word-skipping
to work. In xterm, under OSX this work fine by default, using 'ctrl
+arrow-key', but in iTerm2 there is no response to this key-
combination. I found the wikipage on the project related to
keybindings,

http://code.google.com/p/iterm2/wiki/Keybindings

but was still unable to get this to work, and based on the comments
there it seems like maybe I'm not the only one. I also tried adding
the sequence via the iTerm2 profile editing area however, while I was
able to specify key combination it did seem like it was possible to
bind the combination to the 'word-skipping' action.

Any additional/more detailed help on how to set this up would be
greatly appreciated.

Best

George Nachman

unread,
Apr 10, 2011, 9:03:17 PM4/10/11
to iterm2-...@googlegroups.com
This is handled by your profile's key bindings, and was added as a default recently. If you have been using iTerm2 for a while, you might not have picked up this change. You can fix it by going to prefs->profiles->keys->Load preset...->Xterm Defaults.

These keys send an escape code like ^[[1;5D. It is up to applications (such as vim or emacs) to interpret this as a word-skip. On my system, vim and emacs handle it correctly but tcsh does not.

Joe

unread,
Apr 10, 2011, 11:25:16 PM4/10/11
to iterm2-discuss
Many thanks for the feedback.
Hi,

I tried out this suggestion with both the alpha build and the latest
nightly build (2011-04-10), but I still seem to be doing something
wrong.

Regardless of whether I select the 'xterm defaults' or even 'xterm
with numeric keypad' in the profiles section, the terminal seems to be
stuck responding by printing the control sequence, rather than
performing the desired action.
For example, 'ctrl+leftarrow' simply prints '5D' to the terminal.

As you said, everything works correctly inside emacs (running inside
of iTerm2), so I guess it is not, strictly speaking, an issue with
iTerm2, but I can't seem to figure out how to resolve the issue for
the default bash terminal.

Best

George Nachman

unread,
Apr 10, 2011, 11:51:31 PM4/10/11
to iterm2-...@googlegroups.com, Joe
Put this in your .inputrc. It seems to fix the issue in bash:

"\e[1;5D": backward-word
"\e[1;5C": forward-word

Tim Gray

unread,
Apr 10, 2011, 11:55:18 PM4/10/11
to Joe, iterm2-discuss
On Apr 10, 2011 at 08:25 PM -0700, Joe wrote:
>As you said, everything works correctly inside emacs (running inside
>of iTerm2), so I guess it is not, strictly speaking, an issue with
>iTerm2, but I can't seem to figure out how to resolve the issue for
>the default bash terminal.

Try alt-b and alt-f. You have to have one of your alt keys set to to 'meta'
in the keyboard prefs though.

Joe

unread,
Apr 11, 2011, 12:41:05 AM4/11/11
to iterm2-discuss
Hi,
Thanks again!

On Apr 11, 12:51 pm, George Nachman <gnach...@llamas.org> wrote:
> Put this in your .inputrc. It seems to fix the issue in bash:
>
> "\e[1;5D": backward-word
> "\e[1;5C": forward-word
This worked. I did try the other suggestion on the wiki one more
time just be sure:

>A good compromise is thus using a modifier combination of CTRL and SHIFT with the left/right arrow keys for word jumping. This can be defined as follows:
>"\e[1;6D": backward-word
>"\e[1;6C": forward-word

but this combination did not work for me for some reason. Maybe it
is worth adding the
"\e[1;5D": backward-word
"\e[1;5C": forward-word

to the wikipage as well?

Anyway, sorry for the newb question, and thanks again for the help.
I haven't been using iTerm2 for long, but it only took a day to figure
out that it is a splendid improvement over the default OSX terminal
app.

Best

George Nachman

unread,
Apr 11, 2011, 1:16:45 AM4/11/11
to iterm2-...@googlegroups.com, Joe
On Sun, Apr 10, 2011 at 9:41 PM, Joe <josef.rob...@gmail.com> wrote:
Hi,
 Thanks again!

On Apr 11, 12:51 pm, George Nachman <gnach...@llamas.org> wrote:
> Put this in your .inputrc. It seems to fix the issue in bash:
>
> "\e[1;5D": backward-word
> "\e[1;5C": forward-word
 This worked.  I did try the other suggestion on the wiki one more
time just be sure:

>A good compromise is thus using a modifier combination of CTRL and SHIFT with the left/right arrow keys for word jumping. This can be defined as follows:
>"\e[1;6D": backward-word
>"\e[1;6C": forward-word

 but this combination did not work for me for some reason.

I see we were missing default keymappings for ctrl+shift+arrow. That's been fixed.
 
 Maybe it
is worth adding the
"\e[1;5D": backward-word
"\e[1;5C": forward-word

 to the wikipage as well?


Done.
 
 Anyway, sorry for the newb question, and thanks again for the help.
I haven't been using iTerm2 for long, but it only took a day to figure
out that it is a splendid improvement over the default OSX terminal
app.


Thanks!

-George 

sste...@gmail.com

unread,
Apr 11, 2011, 9:13:21 AM4/11/11
to iterm2-...@googlegroups.com

On Apr 10, 2011, at 11:51 PM, George Nachman wrote:

> Put this in your .inputrc. It seems to fix the issue in bash:
>
> "\e[1;5D": backward-word
> "\e[1;5C": forward-word

Doesn't change anything for me in nightly iTerm2-nightly-2011-04-10.zip.

I don't get control sequences printed out, but no correct movement either.

S

>

Reply all
Reply to author
Forward
0 new messages