diff --git a/config/scripts/pr-e2e-source-routing.mjs b/config/scripts/pr-e2e-source-routing.mjs index ecfc528a113..e0efd468096 100644 --- a/config/scripts/pr-e2e-source-routing.mjs +++ b/config/scripts/pr-e2e-source-routing.mjs @@ -267,7 +267,7 @@ export const PR_E2E_SOURCE_ROUTES = [ ], matches: (file) => isProductSource(file) && - /^(?:config\/scripts\/(?:verify-wsl-e2e-participation|verify-playwright-participation)\.mjs$|src\/main\/(?:wsl[/-]|pty\/.*wsl|providers\/wsl)|src\/shared\/(?:wsl-|windows-terminal-shell)|src\/renderer\/src\/.*(?:terminal-paste|pty-paste)|tests\/e2e\/(?:golden-tab-bar-agent-launch\.spec|terminal-windows-shell-paste-ownership\.spec|helpers\/(?:wsl-golden-stub-agent|golden-stub-agent))|\.github\/(?:actions\/setup-wsl-test-runtime\/|workflows\/windows-wsl-e2e\.yml))/.test( + /^(?:config\/scripts\/(?:verify-wsl-e2e-participation|verify-playwright-participation)\.mjs$|src\/main\/(?:wsl[/-]|pty\/.*wsl|providers\/wsl)|src\/shared\/(?:wsl-|windows-terminal-shell)|src\/renderer\/src\/.*(?:terminal-paste|pty-paste)|tests\/e2e\/(?:golden-tab-bar-agent-launch\.spec|terminal-windows-shell-paste-ownership\.spec|terminal-inline-images-windows\.spec|helpers\/(?:wsl-golden-stub-agent|golden-stub-agent))|\.github\/(?:actions\/setup-wsl-test-runtime\/|workflows\/windows-wsl-e2e\.yml))/.test( file ) }, diff --git a/config/scripts/wsl-e2e-lane-contract.test.mjs b/config/scripts/wsl-e2e-lane-contract.test.mjs index 6790e19e5fe..f10f8284b3f 100644 --- a/config/scripts/wsl-e2e-lane-contract.test.mjs +++ b/config/scripts/wsl-e2e-lane-contract.test.mjs @@ -17,6 +17,7 @@ describe('real WSL terminal lane', () => { 'tests/e2e/helpers/wsl-golden-stub-agent.ts', 'tests/e2e/golden-tab-bar-agent-launch.spec.ts', 'tests/e2e/terminal-windows-shell-paste-ownership.spec.ts', + 'tests/e2e/terminal-inline-images-windows.spec.ts', '.github/actions/setup-wsl-test-runtime/setup.ps1', '.github/workflows/windows-wsl-e2e.yml' ])('routes %s to both WSL sentinels', (path) => { diff --git a/tests/e2e/terminal-inline-images-windows.spec.ts b/tests/e2e/terminal-inline-images-windows.spec.ts index 564598811d4..3251bee9cea 100644 --- a/tests/e2e/terminal-inline-images-windows.spec.ts +++ b/tests/e2e/terminal-inline-images-windows.spec.ts @@ -1,3 +1,6 @@ +import { randomUUID } from 'node:crypto' +import { writeFileSync } from 'node:fs' +import path from 'node:path' import { expect, test } from './helpers/orca-app' import { ensureTerminalVisible, waitForSessionReady } from './helpers/store' import { @@ -21,7 +24,8 @@ test.skip(process.platform !== 'win32', 'Native Windows and WSL PTY coverage') for (const runtime of ['native', 'wsl'] as const) { for (const acceleration of ['off', 'on'] as const) { test(`@headful ${runtime}, ${acceleration}: PTY images and Kitty placeholders render on Windows`, async ({ - orcaPage + orcaPage, + testRepoPath }, testInfo) => { await waitForSessionReady(orcaPage) await ensureTerminalVisible(orcaPage) @@ -70,10 +74,17 @@ for (const runtime of ['native', 'wsl'] as const) { .toBe(acceleration === 'on') const ptyId = await waitForActivePanePtyId(orcaPage) const marker = 'WINDOWS_INLINE_IMAGES_DONE' - const payload = Buffer.from(`${inlineImagePayload(true)}${marker}\r\n`).toString('base64') + const rawPayload = `${inlineImagePayload(true)}${marker}\r\n` + const payload = Buffer.from(rawPayload).toString('base64') + // Why a file: this command is typed at PTY bind, before WSL bash reaches readline; a + // ~25 KB line in the kernel's cooked mode loses everything past 4095 bytes. + const payloadFile = `.orca-inline-images-${randomUUID()}.bin` + if (runtime === 'wsl') { + writeFileSync(path.join(testRepoPath, payloadFile), rawPayload) + } const command = runtime === 'wsl' - ? `printf '%s' '${payload}' | base64 -d; printf 'WSL_IMAGE_PROTOCOL=%s\\n' "$ORCA_IMAGE_PROTOCOL"` + ? `cat ${payloadFile}; rm -f ${payloadFile}; printf 'WSL_IMAGE_PROTOCOL=%s\\n' "$ORCA_IMAGE_PROTOCOL"` : nodeTerminalCommand(['-e', `process.stdout.write(Buffer.from('${payload}', 'base64'))`]) await execInTerminal(orcaPage, ptyId, command) await waitForTerminalOutput(orcaPage, marker, 30_000)