MCPcopy
hub / github.com/garrytan/gstack / raiseHeadedWindowMacOS

Function raiseHeadedWindowMacOS

browse/src/cli.ts:282–292  ·  view source on GitHub ↗

macOS only: pull the headed Chromium window to the user's current Space. * "Google Chrome for Testing" frequently opens behind the active window or on * another Space — the first thing users read as "I can't see the browser" * (#1781). Best-effort, fire-and-forget, never throws. The app name is a

()

Source from the content-addressed store, hash-verified

280 * (#1781). Best-effort, fire-and-forget, never throws. The app name is a fixed
281 * literal (no interpolation). */
282function raiseHeadedWindowMacOS(): void {
283 if (process.platform !== 'darwin') return;
284 try {
285 nodeSpawn('osascript', ['-e', 'tell application "Google Chrome for Testing" to activate'], {
286 stdio: 'ignore',
287 detached: true,
288 }).unref();
289 } catch {
290 // osascript missing or app not present — non-fatal
291 }
292}
293
294// ─── Server Lifecycle ──────────────────────────────────────────
295async function startServer(extraEnv?: Record<string, string>): Promise<ServerState> {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected