irssi keybinding: backward_word/forward_word

0

I'm currently experimenting with irssi as my irc client of choice and I'm getting along pretty well.

BUT there is one thing I still need to get done. Somehow it isn't possible for me to use the usual CTRL+Left/Right to navigate between words in my input line.

For the record: I'm using irssi on a linux-box through a screen session brought to my windows machine via ssh/putty.

I already tried some key binding in irssi, maybe I did them wrong?

/bind meta-n backward_word
/bind meta-m forward_word

both work fine. But neither

/bind ^left backward_word
/bind ^right backward_word

nor

/bind cleft-left backward_word
/bind cleft-right backward_word

work for a CTRL+Left/Right setup.

Any Ideas?

vikenemesh

Posted 2012-11-28T09:51:48.053

Reputation: 3

Answers

0

First: perhaps Shift+ and Shift+ work as substitutes.

But for the problem in hand: it's most probably some input anomaly, where some part of the chain is not really aware of what "language" others are talking. With PuTTY in the mix, this is not unexpected.

A practical way to solve it:

  1. Issue cat in a terminal without arguments and press Ctrl+.
  2. Paste the entire keycode that occurs (^[Od in my case but most probably something else for you since it doesn't work by default) into the irssi bind command:

    /bind yourkeycode backward_word
    

Now it should work. If not, make sure the binding isn't trumped by any else by issuing /bind and see if there are multiple entries.

I use the exact way described above in binding Ctrl+PgUp and Ctrl+PgDn to scroll an external nick list in irssi.

Daniel Andersson

Posted 2012-11-28T09:51:48.053

Reputation: 20 465

I noticed that, inside screen, the sequences displayed by cat are the same for Ctrl + ← and ← . So I guess screen kills the control sequence. I'm going to use Alt + ← now, that still works. Thank you for the hint with cat. – vikenemesh – 2012-11-28T12:07:54.000

@vikenemesh: Ah, yes, if separate key codes are not sent, then it is not possible to fix it within irssi. Perhaps there is some PuTTY setting that could help you to make it send meta character combinations correctly, though, but that's another question. Good of you to notice it. – Daniel Andersson – 2012-11-28T13:27:52.463

PuTTy itself transmitts everything I need, I checked that. Screen seems to eat all Ctrl Sequences, because it can be controlled by them. – vikenemesh – 2012-11-28T19:05:42.940

@vikenemesh: Yes, screen is also a known key code eater (I missed that part of the question). Setting the correct TERM values throughout usually fixes this, somewhat. You should at least be able to make something come through, even though it might not be directly recognized by irssi. Don't give up just yet :-) – Daniel Andersson – 2012-11-29T09:06:52.027

I'm getting back to this if the annoyance will be unbearable, thx. – vikenemesh – 2012-11-29T17:40:33.303