From 77ebc1489ef4f5acce0147b3d7d732a8dc4f63e2 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Thu, 4 Jun 2026 07:36:13 -0700 Subject: [PATCH] fix: hide the osascript raise spawn too; exclude comments from the spawn invariant --- browse/src/cli.ts | 1 + browse/test/cli-windows-hide.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/browse/src/cli.ts b/browse/src/cli.ts index 516fb6eb3..fbd90a848 100644 --- a/browse/src/cli.ts +++ b/browse/src/cli.ts @@ -288,6 +288,7 @@ function raiseHeadedWindowMacOS(): void { nodeSpawn('osascript', ['-e', 'tell application "Google Chrome for Testing" to activate'], { stdio: 'ignore', detached: true, + windowsHide: true, }).unref(); } catch { // osascript missing or app not present — non-fatal diff --git a/browse/test/cli-windows-hide.test.ts b/browse/test/cli-windows-hide.test.ts index cd08adfad..73e377ec4 100644 --- a/browse/test/cli-windows-hide.test.ts +++ b/browse/test/cli-windows-hide.test.ts @@ -74,7 +74,10 @@ describe('detached server spawns carry windowsHide (#1863 fold-in)', () => { }); test('every detached spawn site in cli.ts carries windowsHide:true', () => { - const body = read(CLI); + const body = read(CLI) + .split('\n') + .filter((line) => !line.trim().startsWith('//') && !line.trim().startsWith('*')) + .join('\n'); const detachedSpawns = body.match(/detached:\s*true/g)?.length ?? 0; const windowsHideFlags = body.match(/windowsHide:\s*true/g)?.length ?? 0; expect(windowsHideFlags).toBeGreaterThanOrEqual(detachedSpawns);