Also turn on extended key reporting for CSI > 4; 2 m

This is supported by XTerm and used by vim. Fixes #4075
This commit is contained in:
Kovid Goyal 2021-09-29 11:12:01 +05:30
parent a3b434d2fe
commit a0cee13652
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 4 deletions

View File

@ -278,9 +278,11 @@ oldest entry from the stack must be evicted.
screen is and restore to that mode on exit.
.. note:: In the interests of interoperation, the XTerm specific sequences
`CSI > 4; 1 m` and `CSI > 4; 0 m` are treated as `CSI > 1 u` and `CSI < 1 u`.
These codes cause XTerm to use the CSI u encoding for more keys and are therefore
treated as similar to the disambiguate progressive enhancement.
``CSI > 4; x m` and `CSI > 4; 0 m` are treated as `CSI > 1 u` and `CSI < 1 u`.
Here `x` can be either `1` or `2`. These codes cause XTerm to use the CSI u
encoding for more keys and are therefore treated as similar to the disambiguate
progressive enhancement.
.. _disambiguate:

View File

@ -1066,7 +1066,7 @@ screen_xtmodkeys(Screen *self, uint32_t p1, uint32_t p2) {
// https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-gt-Pp-m.1DB2
// we handle them as being equivalent to push and pop 1 onto the keyboard stack
if ((!p1 && !p2) || (p1 == 4 && p2 == 0)) screen_pop_key_encoding_flags(self, 1);
else if (p1 == 4 && p2 == 1) screen_push_key_encoding_flags(self, 1);
else if (p1 == 4 && (p2 == 1 || p2 == 2)) screen_push_key_encoding_flags(self, 1);
}