Reset the terminal before opening the LXC shell

Write ESC c, the sequence `reset` sends, inside suspend() right before
ssh. The container shell then starts on a clean screen with no
leftover TUI terminal modes. It runs locally, so the container does
not need `reset` installed and `pct enter` is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DuckbootandClaude Opus 5.5 committed 2026-11-02 20:41:24 +01:00
1 parent 40feb125b4
commit cccdaf7209
3 files changed
+26

No files matched your search

+14
View File
@@ -907,3 +907,17 @@ async def test_table_reloads_after_shell(fake, monkeypatch):
await press_t(app, pilot)
await settle(app, pilot)
assert fake.list_calls > before
async def test_terminal_is_reset_inside_suspend_before_ssh(fake, monkeypatch):
# user request: a clean screen (and no leftover TUI terminal modes) in the container shell
fake.guests = [RUNNING_CT]
app = make_app()
events = patch_shell(monkeypatch, app)
resets = []
monkeypatch.setattr(
"cv4pve_tui.app._reset_terminal", lambda: resets.append(list(events))
)
async with app.run_test() as pilot:
await press_t(app, pilot)
assert resets == [[("enter", None)]] # inside suspend, before ssh ran