From 45a5190a0d3680eebffd15b22afd0ef9d90653de Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 30 Nov 2016 16:03:45 +0530 Subject: [PATCH] Handle CSI codes that start with a ; --- kitty/parser.c | 1 + kitty_tests/parser.py | 1 + 2 files changed, 2 insertions(+) diff --git a/kitty/parser.c b/kitty/parser.c index 4490e0fad..622849d58 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -356,6 +356,7 @@ dispatch_csi(Screen *screen, PyObject DUMP_UNUSED *dump_callback) { break; default: if (i > start) params[num_params++] = utoi(buf + start, i - start); + else if (i == start && buf[i] == ';') params[num_params++] = 0; if (num_params >= MAX_PARAMS) { i = num; start = num + 1; } start = i + 1; break; diff --git a/kitty_tests/parser.py b/kitty_tests/parser.py index 32f1bb0e9..907b6aa06 100644 --- a/kitty_tests/parser.py +++ b/kitty_tests/parser.py @@ -108,6 +108,7 @@ class TestParser(BaseTest): pb('\033[38;2;1;2;3;48;2;7;8;9m', ('select_graphic_rendition', '38 2 1 2 3 48 2 7 8 9 ')) self.ae(s.cursor.fg, 1 << 24 | 2 << 16 | 3 << 8 | 2) self.ae(s.cursor.bg, 7 << 24 | 8 << 16 | 9 << 8 | 2) + pb('\033[;2m', ('select_graphic_rendition', '0 2 ')) c = s.callbacks pb('\033[5n', ('report_device_status', 5, 0)) self.ae(c.wtcbuf, b'\033[0n')