From df67f2140337310b44c69bb5410268c9a3760b31 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 11:31:58 +0000 Subject: [PATCH] test(terminal): reproduce missing mouse reports on initial attach A raw-input terminal enables SGR mouse reporting before the web client attaches. A trusted finger drag should reach its stdin, as it does when the same mode is enabled after attachment, but no report arrives. This diagnostic intentionally remains red; it changes no production behavior. --- .../app/e2e/browser/terminal-find.spec.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/packages/app/e2e/browser/terminal-find.spec.ts b/packages/app/e2e/browser/terminal-find.spec.ts index 6e83f095b2..80a7527c7f 100644 --- a/packages/app/e2e/browser/terminal-find.spec.ts +++ b/packages/app/e2e/browser/terminal-find.spec.ts @@ -627,3 +627,36 @@ async function dragTerminalWithFinger( } }); } + +// Diagnostic-only: application modes emitted before the first attachment. +// The existing live-mode tests above are the control for this failure. +test.describe("mouse mode enabled before terminal attachment", () => { + test.use({ isMobile: true, hasTouch: true, viewport: { width: 390, height: 844 } }); + + test("preserves SGR wheel reports when opening a running terminal", async ({ page }) => { + await openPreAttachedMouseCapture(page); + await expectFingerNavigationInput(page, "mouse"); + }); +}); + +async function openPreAttachedMouseCapture(page: Page) { + await harness.createTerminal({ + name: "Mouse mode before attachment", + command: process.execPath, + args: [ + "-e", + ` + process.stdin.setRawMode(true); + process.stdin.on("data", chunk => { + process.stdout.write("\\r\\nTOUCH_BYTES:" + chunk.toString("hex") + ":END\\r\\n"); + }); + process.stdout.write("\\x1b[?1000h\\x1b[?1006hTOUCH_INPUT_READY\\r\\n"); + `, + ], + }); + await openPhoneTerminal(page); + await expect.poll(() => getTerminalBufferText(page)).toContain("TOUCH_INPUT_READY"); + await expect + .poll(() => page.evaluate(() => window.__paseoTerminal!.modes.mouseTrackingMode)) + .toBe("vt200"); +}