3

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

Forethinker
  • 1,399

2 Answers2

4

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

HalosGhost
  • 4,790
remmy
  • 5,055
  • 1
  • 24
  • 30
  • 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 09 '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 – remmy Mar 09 '13 at 21:03
  • What is the difference between a representation of ESC and the actual ESC character? – Forethinker Sep 07 '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. – remmy Sep 10 '13 at 15:15
1

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.

vonbrand
  • 18,253