The bindkey keyword in .screenrc is preceded by some cryptic keys that correspond to some keybouard binding. How can I figure out what these are? Google and GNU Screen Documentation did not show the results I was looking for.
For example, how would you found the bindings below without someone specifically telling you what the binding is?
bindkey "^[[1;5I" next
bindkey "^[[1;6I" prev


The keycodes vary somewhat from terminal to terminal, but check out this resource.

  • I am guessing this binding also works for .minttyrc too. How come it does not apply to... say .inputrc? Also how did you know that these keys are mintty binding? Do you use mintty? – Forethinker Mar 9 '13 at 20:50
  • 1
    They should work just fine in .inputrc, you might have to replace ^[ with \e though, since ^[ is just a representation of ESCAPE and \e is interpreted as an actual ESCAPE character. mintty sends xterm keycodes which are pretty much the standard for modern terminal emulators. No, I don't even use Windows, but their wiki does a pretty good job at explaining how the keycodes are put together IMO – kyrias Mar 9 '13 at 21:03
  • What is the difference between a representation of ESC and the actual ESC character? – Forethinker Sep 7 '13 at 22:46
  • \e is an escape code that turns into an escape character while ^[ is just a way to show one on screen. – kyrias Sep 10 '13 at 15:15

Those are escape secuences, the starting ^[ is a dead giveaway, control-[ is a way of generating the ASCII control character ESC on most keyboards. Terminals use those for moving the cursor, changing text color, and such. Almost all terminals (that certainly includes the terminal emulators like xterm or similar under X, but also others) handle the ANSI escape secuences, in turn standardized/extended from those handled by the venerable (and wildly successful) VT-100.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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