diff --git a/packages/coding-agent/src/cli/stats-cli.ts b/packages/coding-agent/src/cli/stats-cli.ts index ba27f09fd..c5f3a9275 100644 --- a/packages/coding-agent/src/cli/stats-cli.ts +++ b/packages/coding-agent/src/cli/stats-cli.ts @@ -114,6 +114,7 @@ export async function runStatsCommand(cmd: StatsCommandArgs): Promise { Bun.spawn(openCommand === "cmd" ? ["cmd", "/c", "start", url] : [openCommand, url], { stdout: "ignore", stderr: "ignore", + windowsHide: true, }).unref(); console.log("Press Ctrl+C to stop\n"); diff --git a/packages/coding-agent/src/commit/git/operations.ts b/packages/coding-agent/src/commit/git/operations.ts index bd1878c1b..1a62081ce 100644 --- a/packages/coding-agent/src/commit/git/operations.ts +++ b/packages/coding-agent/src/commit/git/operations.ts @@ -37,6 +37,7 @@ export async function commit(cwd: string, message: string): Promise { stdin: Buffer.from(message), stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const [stdout, stderr, exitCode] = await Promise.all([ diff --git a/packages/coding-agent/src/debug/index.ts b/packages/coding-agent/src/debug/index.ts index f695fa812..e91c462ea 100644 --- a/packages/coding-agent/src/debug/index.ts +++ b/packages/coding-agent/src/debug/index.ts @@ -310,7 +310,7 @@ export class DebugSelectorComponent extends Container { const [cmd, ...args] = openArgs; try { - Bun.spawn([cmd, ...args], { stdout: "ignore", stderr: "ignore" }).unref(); + Bun.spawn([cmd, ...args], { stdout: "ignore", stderr: "ignore", windowsHide: true }).unref(); this.ctx.showStatus(`Opened: ${artifactsDir}`); } catch (err) { this.ctx.showError(`Failed to open artifact folder: ${err instanceof Error ? err.message : String(err)}`); diff --git a/packages/coding-agent/src/extensibility/plugins/installer.ts b/packages/coding-agent/src/extensibility/plugins/installer.ts index 0cfb29fb9..76b161ed3 100644 --- a/packages/coding-agent/src/extensibility/plugins/installer.ts +++ b/packages/coding-agent/src/extensibility/plugins/installer.ts @@ -50,6 +50,7 @@ export async function installPlugin(packageName: string): Promise { stdin: "ignore", stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const exitCode = await proc.exited; diff --git a/packages/coding-agent/src/extensibility/plugins/manager.ts b/packages/coding-agent/src/extensibility/plugins/manager.ts index 21b3e12a9..0f445fcb5 100644 --- a/packages/coding-agent/src/extensibility/plugins/manager.ts +++ b/packages/coding-agent/src/extensibility/plugins/manager.ts @@ -159,6 +159,7 @@ export class PluginManager { stdin: "ignore", stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const exitCode = await proc.exited; @@ -239,6 +240,7 @@ export class PluginManager { stdin: "ignore", stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const exitCode = await proc.exited; @@ -621,6 +623,7 @@ export class PluginManager { stdin: "ignore", stdout: "pipe", stderr: "pipe", + windowsHide: true, }); return (await proc.exited) === 0; } catch { diff --git a/packages/coding-agent/src/ipy/gateway-coordinator.ts b/packages/coding-agent/src/ipy/gateway-coordinator.ts index 12dfee17e..a4494f236 100644 --- a/packages/coding-agent/src/ipy/gateway-coordinator.ts +++ b/packages/coding-agent/src/ipy/gateway-coordinator.ts @@ -420,6 +420,7 @@ async function startGatewayProcess( stdout: "pipe", stderr: "pipe", detached: true, + windowsHide: true, env: kernelEnv, }, ); diff --git a/packages/coding-agent/src/lsp/clients/biome-client.ts b/packages/coding-agent/src/lsp/clients/biome-client.ts index 2fa31c1bb..2e81566b2 100644 --- a/packages/coding-agent/src/lsp/clients/biome-client.ts +++ b/packages/coding-agent/src/lsp/clients/biome-client.ts @@ -86,6 +86,7 @@ async function runBiome( cwd, stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const [stdout, stderr] = await Promise.all([new Response(proc.stdout).text(), new Response(proc.stderr).text()]); diff --git a/packages/coding-agent/src/lsp/index.ts b/packages/coding-agent/src/lsp/index.ts index 927251a71..7b2f93bd0 100644 --- a/packages/coding-agent/src/lsp/index.ts +++ b/packages/coding-agent/src/lsp/index.ts @@ -437,6 +437,7 @@ async function runWorkspaceDiagnostics( cwd, stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const [stdout, stderr] = await Promise.all([new Response(proc.stdout).text(), new Response(proc.stderr).text()]); diff --git a/packages/coding-agent/src/lsp/lspmux.ts b/packages/coding-agent/src/lsp/lspmux.ts index 8b629b613..49d14d728 100644 --- a/packages/coding-agent/src/lsp/lspmux.ts +++ b/packages/coding-agent/src/lsp/lspmux.ts @@ -104,6 +104,7 @@ async function checkServerRunning(binaryPath: string): Promise { const proc = Bun.spawn([binaryPath, "status"], { stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const exited = await Promise.race([ diff --git a/packages/coding-agent/src/utils/clipboard.ts b/packages/coding-agent/src/utils/clipboard.ts index 87ebb0930..4c4730917 100644 --- a/packages/coding-agent/src/utils/clipboard.ts +++ b/packages/coding-agent/src/utils/clipboard.ts @@ -37,25 +37,33 @@ export async function copyToClipboard(text: string): Promise { try { if (p === "darwin") { - await Bun.spawn(["pbcopy"], { stdin: Buffer.from(text), timeout }).exited; + await Bun.spawn(["pbcopy"], { stdin: Buffer.from(text), timeout, windowsHide: true }).exited; } else if (p === "win32") { - await Bun.spawn(["clip"], { stdin: Buffer.from(text), timeout }).exited; + await Bun.spawn(["clip"], { stdin: Buffer.from(text), timeout, windowsHide: true }).exited; } else { const wayland = isWaylandSession(); if (wayland) { const wlCopyPath = Bun.which("wl-copy"); if (wlCopyPath) { // Fire-and-forget: wl-copy may not exit promptly, so we unref to avoid blocking - void Bun.spawn([wlCopyPath], { stdin: Buffer.from(text), timeout }).unref(); + void Bun.spawn([wlCopyPath], { stdin: Buffer.from(text), timeout, windowsHide: true }).unref(); return; } } // Linux - try xclip first, fall back to xsel try { - await Bun.spawn(["xclip", "-selection", "clipboard"], { stdin: Buffer.from(text), timeout }).exited; + await Bun.spawn(["xclip", "-selection", "clipboard"], { + stdin: Buffer.from(text), + timeout, + windowsHide: true, + }).exited; } catch { - await Bun.spawn(["xsel", "--clipboard", "--input"], { stdin: Buffer.from(text), timeout }).exited; + await Bun.spawn(["xsel", "--clipboard", "--input"], { + stdin: Buffer.from(text), + timeout, + windowsHide: true, + }).exited; } } } catch (error) { diff --git a/packages/tui/src/autocomplete.ts b/packages/tui/src/autocomplete.ts index 11f457b7e..72f90c185 100644 --- a/packages/tui/src/autocomplete.ts +++ b/packages/tui/src/autocomplete.ts @@ -60,6 +60,7 @@ async function walkDirectoryWithFd( const proc = Bun.spawn([fdPath, ...args], { stdout: "pipe", stderr: "pipe", + windowsHide: true, }); const exitCode = await proc.exited; diff --git a/packages/utils/src/procmgr.ts b/packages/utils/src/procmgr.ts index f959f85ab..5e9d21615 100644 --- a/packages/utils/src/procmgr.ts +++ b/packages/utils/src/procmgr.ts @@ -294,6 +294,7 @@ export async function terminate(options: TerminateOptions): Promise { stdout: "ignore", stderr: "ignore", timeout: 5000, + windowsHide: true, }); void taskkill.exited.catch(() => {}); taskkill.unref(); diff --git a/packages/utils/src/ptree.ts b/packages/utils/src/ptree.ts index f2bb40da9..defb2904c 100644 --- a/packages/utils/src/ptree.ts +++ b/packages/utils/src/ptree.ts @@ -447,6 +447,7 @@ export function spawn(cmd: string[], options?: Child stdout: "pipe", stderr: "pipe", detached, + windowsHide: true, ...rest, }); const cproc = new ChildProcess(child, detached);