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
2 Answers
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? Mar 9, 2013 at 20:50
-
1They 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– remmyMar 9, 2013 at 21:03
-
What is the difference between a representation of ESC and the actual ESC character? Sep 7, 2013 at 22:46
-
\e is an escape code that turns into an escape character while ^[ is just a way to show one on screen.– remmySep 10, 2013 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.