Running GNU screen on Ubuntu 14.04.4 LTS remotely from a windows machine. I am trying to change the keybinding in ~/.screenrc. To navigate between the windows,

# control-left and control-right switch windows
bindkey "^[[5D" prev
bindkey "^[[5C" next

[[5D and [[5C do not translate to -> and <- keys. Manpage of GNU screenadvices to use caret for ctrl key. However, it does not say anything about other keys such as tab, shift etc.

How do I represent such keystrokes?

What exactly are these symbols([5D and [5C) ? Where do I get the list for all such symbols?

Note - The terminal emulator I am using is GNU Screen

Edit - so, the symbols are ASCII Escape Sequences. LINK


The ^[ in your example represents a single character: ASCII escape (code 27). The various sequences depend on the terminal you are using, as well as whether it is using normal- or application-mode.

GNU screen doesn't determine those sequences; it allows (most) conventional function-keys to pass through. Whatever the actual terminal you are using from Windows would be the place to look for documentation.

In normal mode, cursor-keys for VT100-like terminals (including xterm) send Escape, followed by [, optionally followed by one or more numeric parameters and terminated by one of A, B, C or D. The first two characters change in application mode to Escape followed by the letter O. Each of these features has names, e.g., as listed in XTerm Control Sequences (CSI, SS3, final byte).

Normally the first (optional) parameter would be a repeat count. An early version of xterm's modifier keys would instead send a parameter corresponding to the type of modifier (5 being control). For quite a while, that modifier information has been in the second parameter, e.g.,


for control up-arrow. Modifiers like this (and in fact as used for function keys — not VT100 anyway) are not VT100 features but adapted in xterm from a description of the VT510 or a similar model.

Further reading:

  • I am using XShell with type Xterm terminal, on windows. But, I tried using xterm sequences too. How does the mode factor effect? – user1382937 Aug 23 '17 at 21:52
  • If XShell has documentation, that's the place to go. I've seen nothing except advertisements for XShell, no documentation. – Thomas Dickey Aug 23 '17 at 22:11

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.