diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index de92756af..1d278418c 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -39,6 +39,10 @@ - Replaced libarchive-based tar parsing with a hardened, in-process tar reader to prevent crashes and safely handle complex archive structures, symlinks, and sparse metadata. - Fixed `Ctrl+O` tool-output expansion failing to reach launch-completion messages wrapped in the hidden tool activity container. +### Fixed + +- Fixed open browser behaviour on Windows, OMP console no longer disappears on commands such as `/stats` + ## [17.2.14] - 2026-08-11 ### Added diff --git a/packages/coding-agent/src/utils/open.ts b/packages/coding-agent/src/utils/open.ts index 413e9ca2e..54c6285d7 100644 --- a/packages/coding-agent/src/utils/open.ts +++ b/packages/coding-agent/src/utils/open.ts @@ -69,8 +69,6 @@ function windowsOpenerCommand(target: string): string[] { powershell, "-NoProfile", "-NonInteractive", - "-WindowStyle", - "Hidden", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64"), ]; @@ -93,7 +91,12 @@ export function openPath(urlOrPath: string): void { } let child: Bun.Subprocess | undefined; try { - child = Bun.spawn(cmd, { stdin: "ignore", stdout: "ignore", stderr: "ignore" }); + child = Bun.spawn(cmd, { + stdin: "ignore", + stdout: "ignore", + stderr: "ignore", + windowsHide: process.platform === "win32", + }); } catch (error) { // Spawn threw synchronously (missing binary, denied exec, sandbox // restriction, …). Best-effort: log so the failure isn't invisible while diff --git a/packages/coding-agent/test/utils/open.test.ts b/packages/coding-agent/test/utils/open.test.ts index 11d28a46d..36ece3457 100644 --- a/packages/coding-agent/test/utils/open.test.ts +++ b/packages/coding-agent/test/utils/open.test.ts @@ -159,13 +159,8 @@ describe("openPath", () => { // on Windows boxes where the machine PATH no longer references // System32. expect(call?.cmd[0]).toBe(powershellPath); - expect(call?.cmd.slice(1, -1)).toEqual([ - "-NoProfile", - "-NonInteractive", - "-WindowStyle", - "Hidden", - "-EncodedCommand", - ]); + expect(call?.cmd.slice(1, -1)).toEqual(["-NoProfile", "-NonInteractive", "-EncodedCommand"]); + expect(call?.options.windowsHide).toBe(true); // The target rides inside the UTF-16LE payload: no cmd/PowerShell // metacharacter parsing ever sees the `&` in the query string, and the // terminating error preference makes Start-Process failures exit 1 so