From 68993b7ab35239ec44eb69c169de3c43ae4f1903 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Wed, 22 Jul 2026 13:16:27 +0200 Subject: [PATCH] fix(desktop): preserve Windows terminal hook smoke command The outer batch shell expanded the hook variable and control operators before terminal send-keys received them. Encode the probe for PowerShell so expansion happens inside the packaged terminal. --- packages/desktop/scripts/smoke-packaged-desktop-app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/desktop/scripts/smoke-packaged-desktop-app.js b/packages/desktop/scripts/smoke-packaged-desktop-app.js index f96834d31..0c5e2b798 100644 --- a/packages/desktop/scripts/smoke-packaged-desktop-app.js +++ b/packages/desktop/scripts/smoke-packaged-desktop-app.js @@ -130,7 +130,13 @@ function shellQuoteCliArg(value) { function getTerminalHookSmokeCommand(marker) { if (process.platform === "win32") { - return `"%PASEO_HOOK_CLI%" hooks codex Stop && echo ${marker}`; + const script = [ + "& $env:PASEO_HOOK_CLI hooks codex Stop", + "if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }", + `Write-Output '${marker}'`, + ].join("; "); + const encodedScript = Buffer.from(script, "utf16le").toString("base64"); + return `powershell.exe -NoProfile -NonInteractive -EncodedCommand ${encodedScript}`; } return `"$PASEO_HOOK_CLI" hooks codex Stop && echo ${marker}`;