mirror of https://github.com/openclaw/openclaw.git
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:
parent
9044a10c5f
commit
9da06d918f
|
|
@ -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,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ function runTaskkill(args: string[]): void {
|
|||
spawn("taskkill", args, {
|
||||
stdio: "ignore",
|
||||
detached: true,
|
||||
windowsHide: true,
|
||||
});
|
||||
} catch {
|
||||
// Ignore taskkill spawn failures
|
||||
|
|
|
|||
Loading…
Reference in New Issue