From ab64bebe14b8e30c576457292f7e3ec19ab21028 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:01:43 +0000 Subject: [PATCH] test(terminal): prepare replay input before signaling readiness (#9211) The replay fixture used its last history row as readiness before installing readline. Register the input handler first so the parent cannot send the pre-cut command during that setup gap. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- packages/server/src/terminal/worker-terminal-manager.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/terminal/worker-terminal-manager.test.ts b/packages/server/src/terminal/worker-terminal-manager.test.ts index b13e63b074..e57e413b4c 100644 --- a/packages/server/src/terminal/worker-terminal-manager.test.ts +++ b/packages/server/src/terminal/worker-terminal-manager.test.ts @@ -1796,7 +1796,6 @@ it("replays bounded ANSI chunks independently of live output and reconstructs th rows: 8, cols: 120, ...nodeTerminalCommand(` - for (let i = 0; i < 800; i++) process.stdout.write("\\x1b[31m" + String(i).padStart(4, "0") + ":" + "x".repeat(100) + "\\x1b[0m\\r\\n"); require("node:readline").createInterface({ input: process.stdin }).on("line", line => { if (line !== "before") { process.stdout.write("LIVE-AFTER-REPLAY\\r\\n"); return; } process.stdout.write("PRE-CUT"); @@ -1806,6 +1805,9 @@ it("replays bounded ANSI chunks independently of live output and reconstructs th process.stdout.write("\\r\\n"); }, 5); }); + // The last history row is the parent's readiness signal. Install input + // handling first so observing that row means the fixture can answer. + for (let i = 0; i < 800; i++) process.stdout.write("\\x1b[31m" + String(i).padStart(4, "0") + ":" + "x".repeat(100) + "\\x1b[0m\\r\\n"); setInterval(() => {}, 1000); `), }),