Fix double redraw flash on reconnect

- Remove separate force_redraw on WebSocket connect
- Integrate size toggle into set_terminal_size for single redraw
- Update test to expect two executor calls (toggle pattern)
This commit is contained in:
GitHub Copilot
2026-01-24 16:48:53 +00:00
parent 032d46b2a9
commit 3f265f19dc
3 changed files with 8 additions and 6 deletions
+4 -1
View File
@@ -377,7 +377,10 @@ class TestTerminalSession:
with patch.object(loop, "run_in_executor", new=AsyncMock()) as run_in_executor:
await session.set_terminal_size(80, 24)
run_in_executor.assert_awaited_once_with(None, session._set_terminal_size, 80, 24)
# set_terminal_size toggles size (-1 then restore) to force redraw
assert run_in_executor.await_count == 2
run_in_executor.assert_any_await(None, session._set_terminal_size, 79, 24)
run_in_executor.assert_any_await(None, session._set_terminal_size, 80, 24)
def test__set_terminal_size_calls_ioctl(self):
from textual_webterm.terminal_session import TerminalSession