This commit is contained in:
Kovid Goyal 2019-02-26 06:56:25 +05:30
parent 61a9f7baae
commit e33af8b2f8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View File

@ -612,7 +612,7 @@ dispatch_csi(Screen *screen, PyObject DUMP_UNUSED *dump_callback) {
unsigned int num = screen->parser_buf_pos, start, i, num_params=0, p1, p2; unsigned int num = screen->parser_buf_pos, start, i, num_params=0, p1, p2;
static unsigned int params[MAX_PARAMS] = {0}; static unsigned int params[MAX_PARAMS] = {0};
bool private; bool private;
if (buf[0] == '>' || buf[0] == '?' || buf[0] == '!') { if (buf[0] == '>' || buf[0] == '?' || buf[0] == '!' || buf[0] == '=') {
start_modifier = (char)screen->parser_buf[0]; start_modifier = (char)screen->parser_buf[0];
buf++; num--; buf++; num--;
} }
@ -993,6 +993,7 @@ accumulate_csi(Screen *screen, uint32_t ch, PyObject DUMP_UNUSED *dump_callback)
case '?': case '?':
case '>': case '>':
case '!': case '!':
case '=':
if (screen->parser_buf_pos != 0) { if (screen->parser_buf_pos != 0) {
REPORT_ERROR("Invalid character in CSI: 0x%x, ignoring the sequence", ch); REPORT_ERROR("Invalid character in CSI: 0x%x, ignoring the sequence", ch);
SET_STATE(0); SET_STATE(0);

View File

@ -114,6 +114,7 @@ class TestParser(BaseTest):
pb('\033[20;4h', ('screen_set_mode', 20, 0), ('screen_set_mode', 4, 0)) pb('\033[20;4h', ('screen_set_mode', 20, 0), ('screen_set_mode', 4, 0))
pb('\033[?1000;1004h', ('screen_set_mode', 1000, 1), ('screen_set_mode', 1004, 1)) pb('\033[?1000;1004h', ('screen_set_mode', 1000, 1), ('screen_set_mode', 1004, 1))
pb('\033[20;4;20l', ('screen_reset_mode', 20, 0), ('screen_reset_mode', 4, 0), ('screen_reset_mode', 20, 0)) pb('\033[20;4;20l', ('screen_reset_mode', 20, 0), ('screen_reset_mode', 4, 0), ('screen_reset_mode', 20, 0))
pb('\033[=c', ('report_device_attributes', 0, 61))
s.reset() s.reset()
def sgr(params): def sgr(params):