From 7e936d87e03446d58d45836eee2696c67d2d59bf Mon Sep 17 00:00:00 2001 From: Hassan Raza Date: Sat, 17 Oct 2026 13:37:10 +0500 Subject: [PATCH] Cover origin-relative cursor position reports --- kitty_tests/parser.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kitty_tests/parser.py b/kitty_tests/parser.py index af8e6dc61..1d2caf474 100644 --- a/kitty_tests/parser.py +++ b/kitty_tests/parser.py @@ -1013,6 +1013,19 @@ class TestParser(BaseTest): self.ae(c.wtcbuf, b'\x1b[?2033;1$y') pb('\033[?2033l', ('screen_reset_mode', 2033, 1)) + def test_cursor_position_report_origin_mode(self) -> None: + s = self.create_screen(cols=10, lines=10) + for top in (1, 3): + for origin in (False, True): + parse_bytes(s, f'\033[{top};8r\033[?6{"h" if origin else "l"}'.encode()) + for row in (1, 4): + parse_bytes(s, f'\033[{row};5H'.encode()) + for private in ('', '?'): + with self.subTest(top=top, origin=origin, row=row, private=private): + s.callbacks.clear() + parse_bytes(s, f'\033[{private}6n'.encode()) + self.ae(s.callbacks.wtcbuf, f'\033[{private}{row};5R'.encode()) + def test_malformed_csi_subparam_does_not_corrupt_sgr(self): # Regression for #10434: \e[?:m sets is_sub_param[0]=true in the CSI # state. reset_csi must clear that flag so the next SGR isn't rejected.