From 759c900a46309e8b66e9d67e58abdc69fc71de4c Mon Sep 17 00:00:00 2001 From: alan Date: Tue, 10 Mar 2026 16:07:46 +0800 Subject: [PATCH] fix: suppress stdout/stderr leak into TUI by using pipe instead of inherit When oh-my-opencode runs as an OpenCode plugin, it shares the same process and terminal fd as the TUI. Using stdout/stderr: "inherit" in spawned subprocesses (bun install, on-complete hooks) causes their output to leak directly into the TUI's alternate screen, rendering garbage text over the UI. This changes all subprocess spawn calls that used "inherit" to use "pipe" instead, silencing their output when running inside the TUI. Affected files: - src/cli/config-manager/bun-install.ts: bun install output leak - src/cli/run/on-complete-hook.ts: on-complete hook output leak --- src/cli/config-manager/bun-install.ts | 4 ++-- src/cli/run/on-complete-hook.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/config-manager/bun-install.ts b/src/cli/config-manager/bun-install.ts index 230b03eaee..20466d5f9e 100644 --- a/src/cli/config-manager/bun-install.ts +++ b/src/cli/config-manager/bun-install.ts @@ -31,8 +31,8 @@ export async function runBunInstallWithDetails(): Promise { try { const proc = spawnWithWindowsHide(["bun", "install"], { cwd: cacheDir, - stdout: "inherit", - stderr: "inherit", + stdout: "pipe", + stderr: "pipe", }) let timeoutId: ReturnType diff --git a/src/cli/run/on-complete-hook.ts b/src/cli/run/on-complete-hook.ts index b266ca8872..19fad98d4f 100644 --- a/src/cli/run/on-complete-hook.ts +++ b/src/cli/run/on-complete-hook.ts @@ -26,8 +26,8 @@ export async function executeOnCompleteHook(options: { DURATION_MS: String(durationMs), MESSAGE_COUNT: String(messageCount), }, - stdout: "inherit", - stderr: "inherit", + stdout: "pipe", + stderr: "pipe", }) const hookExitCode = await proc.exited