Merge PR #8288: Fix open browser behaviour on Windows (@x86matthew)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user