Make C1 handling UTF-8 safe

This commit is contained in:
GitHub Copilot
2026-02-01 09:45:23 +00:00
parent fadde71aa5
commit 381d844068
5 changed files with 144 additions and 49 deletions
+7
View File
@@ -117,6 +117,13 @@ class TestTerminalSession:
assert lines[1] == "Updated Line 2"
assert lines[2] == "Line 3"
@pytest.mark.asyncio
async def test_screen_preserves_utf8_bytes_with_c1_values(self, terminal_session):
"""Ensure UTF-8 bytes containing 0x9c aren't corrupted by C1 normalization."""
await terminal_session._update_screen("✓ ok\r\n".encode())
lines = await terminal_session.get_screen_lines()
assert "✓ ok" in lines[0]
@pytest.mark.asyncio
async def test_get_screen_state_returns_dirty_flag(self, terminal_session):
"""Test that get_screen_state returns has_changes flag based on pyte dirty tracking."""