Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to bind a command to ctrl-up, but /bind ^up doesn't work the way I expect. I'm guessing it's being parsed as ctrl-U+P.

Is there a way to do this?

share|improve this question
up vote 3 down vote accepted

I opened a terminal, issued cat without parameters and pressed Ctrl+Up and Ctrl+Down. This generated the key codes ^[Oa and ^[Ob for me (do it yourself, the exact codes can rely on terminal, etc.). I then pasted this into irssi as

/bind ^[Oa next_window
/bind ^[Ob previous_window

and now Ctrl+Up and Ctrl+Down goes to the next/previous window respectively.

share|improve this answer
When I try this - I get the same codes for Up and ctrl-up. – zigdon Apr 17 '12 at 7:40
Which terminal do you use? Do you run it through tmux/GNU Screen/PuTTY/similar? If you get the same key codes (in the same environment as irssi), then you can not bind them separately, so this needs to be fixed. If you are using e.g. tmux, you should add set-window-option -g xterm-keys on in your ~/.tmux.conf to catch more key codes, and similar options might exist for other configurations. – Daniel Andersson Apr 17 '12 at 7:46
screen/putty. Is there a similar option for screen? – zigdon Apr 17 '12 at 7:55
Search and ye shall find :-) :… – Daniel Andersson Apr 17 '12 at 8:40
the easiest way to find the code is by running cat and then typing the desired combo – shime Sep 4 '14 at 9:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .