Files
oh-my-pi/packages/coding-agent/src/launch/spawn-options.test.ts
T
roboomp 382f932d53 fix(launch): hid Windows daemon console windows
Applied console-aware spawn options to both non-PTY daemon paths. Windows children now stay attached when the host has a console and use CREATE_NO_WINDOW only for headless hosts.

Fixes #6018
2026-07-18 21:35:04 +00:00

32 lines
836 B
TypeScript

import { describe, expect, it } from "bun:test";
import { resolveDaemonSpawnOptions } from "./spawn-options";
describe("resolveDaemonSpawnOptions", () => {
it("hides Windows daemons when the host has no console", () => {
expect(
resolveDaemonSpawnOptions({
platform: "win32",
hostHasInheritableConsole: false,
}),
).toEqual({ detached: false, windowsHide: true });
});
it("inherits the Windows host console instead of detaching", () => {
expect(
resolveDaemonSpawnOptions({
platform: "win32",
hostHasInheritableConsole: true,
}),
).toEqual({ detached: false, windowsHide: false });
});
it("keeps POSIX daemons in their own session", () => {
expect(
resolveDaemonSpawnOptions({
platform: "linux",
hostHasInheritableConsole: false,
}),
).toEqual({ detached: true });
});
});