fix(windows): add windowsHide to detached spawn calls to suppress console windows (#44693)

The restart helper and taskkill spawn calls were missing windowsHide: true,
causing visible command prompt windows to flash on screen during gateway
restart and process cleanup on Windows.
This commit is contained in:
MoerAI 2026-03-13 16:40:26 +09:00 committed by Peter Steinberger
parent 9044a10c5f
commit 9da06d918f
3 changed files with 5 additions and 0 deletions

View File

@ -287,6 +287,7 @@ describe("restart-helper", () => {
expect(spawn).toHaveBeenCalledWith("/bin/sh", [scriptPath], {
detached: true,
stdio: "ignore",
windowsHide: true,
});
expect(mockChild.unref).toHaveBeenCalled();
});
@ -302,6 +303,7 @@ describe("restart-helper", () => {
expect(spawn).toHaveBeenCalledWith("cmd.exe", ["/d", "/s", "/c", scriptPath], {
detached: true,
stdio: "ignore",
windowsHide: true,
});
expect(mockChild.unref).toHaveBeenCalled();
});
@ -317,6 +319,7 @@ describe("restart-helper", () => {
expect(spawn).toHaveBeenCalledWith("cmd.exe", ["/d", "/s", "/c", `"${scriptPath}"`], {
detached: true,
stdio: "ignore",
windowsHide: true,
});
});
});

View File

@ -169,6 +169,7 @@ export async function runRestartScript(scriptPath: string): Promise<void> {
const child = spawn(file, args, {
detached: true,
stdio: "ignore",
windowsHide: true,
});
child.unref();
}

View File

@ -83,6 +83,7 @@ function runTaskkill(args: string[]): void {
spawn("taskkill", args, {
stdio: "ignore",
detached: true,
windowsHide: true,
});
} catch {
// Ignore taskkill spawn failures