Fix styled switch-back repaint

This commit is contained in:
2026-05-14 17:20:23 +01:00
parent d5ee50fa65
commit 36e738b5c6
12 changed files with 423 additions and 62 deletions

View File

@@ -0,0 +1,35 @@
{
"name": "switch_replay_clears_viewport",
"cols": 80,
"rows": 24,
"scripts": [
{
"name": "blanktop",
"body": "#!/bin/sh\nprintf '\\033[2;1HFIRST-ROW-TWO\\n'\nsleep 5\n"
}
],
"steps": [
{
"type": "mcp_call",
"method": "spawn_process",
"params": { "kind": "command", "argv": ["blanktop"], "name": "first" },
"save_as": "first"
},
{ "type": "wait_text", "contains": "FIRST-ROW-TWO", "timeout_ms": 5000 },
{
"type": "mcp_call",
"method": "spawn_process",
"params": { "kind": "command", "argv": ["sh", "-lc", "echo SECOND READY; sleep 5"], "name": "second" },
"save_as": "second"
},
{ "type": "wait_text", "contains": "SECOND READY", "timeout_ms": 5000 },
{
"type": "mcp_call",
"method": "select_process",
"params": { "process_id": "{{first.process_id}}" }
},
{ "type": "wait_stable", "timeout_ms": 5000 },
{ "type": "assert_contains", "contains": "FIRST-ROW-TWO" },
{ "type": "assert_not_contains", "contains": "SECOND READY" }
]
}

View File

@@ -0,0 +1,36 @@
{
"name": "switch_replay_preserves_color",
"cols": 80,
"rows": 24,
"scripts": [
{
"name": "color-frame",
"body": "#!/bin/sh\nprintf '\\033[31mREDMARK\\033[0m\\n'\nsleep 5\n"
}
],
"steps": [
{
"type": "mcp_call",
"method": "spawn_process",
"params": { "kind": "command", "argv": ["color-frame"], "name": "color" },
"save_as": "color"
},
{ "type": "wait_text", "contains": "REDMARK", "timeout_ms": 5000 },
{
"type": "mcp_call",
"method": "spawn_process",
"params": { "kind": "command", "argv": ["sh", "-lc", "echo SECOND READY; sleep 5"], "name": "second" },
"save_as": "second"
},
{ "type": "wait_text", "contains": "SECOND READY", "timeout_ms": 5000 },
{ "type": "mark_raw", "save_as": "before_switch_back" },
{
"type": "mcp_call",
"method": "select_process",
"params": { "process_id": "{{color.process_id}}" }
},
{ "type": "wait_stable", "timeout_ms": 5000 },
{ "type": "assert_contains", "contains": "REDMARK" },
{ "type": "assert_raw_since_regex", "from": "before_switch_back", "regex": "\u001b\\[[0-9;]*38;2;[^m]*mREDMARK" }
]
}