Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 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 :-) : serverfault.com/questions/130128/… –  Daniel Andersson Apr 17 '12 at 8:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.