mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
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.
This commit is contained in:
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user