From 45c084b861e01c614701e58c55945dadc2b54ea4 Mon Sep 17 00:00:00 2001 From: Deepanshu Pal Date: Sat, 19 Sep 2026 14:04:40 +0530 Subject: [PATCH] fix(browse): hide daemon console on Windows --- packages/cli/src/lib/driver/daemon/client.ts | 1 + packages/cli/tests/driver-foundation.test.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/cli/src/lib/driver/daemon/client.ts b/packages/cli/src/lib/driver/daemon/client.ts index 260c56b63..4fb12967d 100644 --- a/packages/cli/src/lib/driver/daemon/client.ts +++ b/packages/cli/src/lib/driver/daemon/client.ts @@ -290,6 +290,7 @@ function spawnDaemon(session: string, target: ConnectionTarget): void { detached: true, env: process.env, stdio: "ignore", + windowsHide: true, }, ); child.unref(); diff --git a/packages/cli/tests/driver-foundation.test.ts b/packages/cli/tests/driver-foundation.test.ts index f2422f4ae..3a3eee063 100644 --- a/packages/cli/tests/driver-foundation.test.ts +++ b/packages/cli/tests/driver-foundation.test.ts @@ -57,6 +57,19 @@ afterEach(async () => { }); describe("driver foundation", () => { + it("hides the detached daemon window on Windows", async () => { + const source = await fs.readFile( + new URL("../src/lib/driver/daemon/client.ts", import.meta.url), + "utf8", + ); + const spawnDaemon = source.slice( + source.indexOf("function spawnDaemon"), + source.indexOf("async function waitForSocketReady"), + ); + + expect(spawnDaemon).toContain("windowsHide: true"); + }); + it("defaults remote mode from BROWSERBASE_API_KEY", async () => { const previousApiKey = process.env.BROWSERBASE_API_KEY; process.env.BROWSERBASE_API_KEY = "test-key";