Skip to content

Commit 48d43d4

Browse files
committed
Add test for private SGR sequence handling
- Add test_private_sgr_sequence_ignored() to verify Vim 9.0+ modifyOtherKeys query is ignored - Test ensures private SGR sequences don't affect screen display, modes, or cursor state
1 parent edd650f commit 48d43d4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_screen.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,3 +1583,24 @@ def test_screen_set_icon_name_title():
15831583

15841584
screen.set_title(text)
15851585
assert screen.title == text
1586+
1587+
1588+
def test_private_sgr_sequence_ignored():
1589+
def cursor_state(cursor):
1590+
return (cursor.x, cursor.y, cursor.attrs, cursor.hidden)
1591+
1592+
screen = pyte.HistoryScreen(2, 2)
1593+
stream = pyte.ByteStream(screen)
1594+
1595+
# Capture initial state
1596+
display = screen.display
1597+
mode = screen.mode.copy()
1598+
cursor = cursor_state(screen.cursor)
1599+
1600+
# Vim 9.0+ sends this to query modifyOtherKeys capability - should be ignored
1601+
stream.feed(b'\x1b[?4m')
1602+
1603+
# Verify nothing changed
1604+
assert screen.display == display
1605+
assert screen.mode == mode
1606+
assert cursor_state(screen.cursor) == cursor

0 commit comments

Comments
 (0)