From 711a6675ca7cff05241cfd68c6003530024eed7d Mon Sep 17 00:00:00 2001 From: graelo Date: Thu, 12 Mar 2026 12:11:08 +0100 Subject: [PATCH 1/2] feat(tui): add per-tool output visibility via show_tool_output config Add a `show_tool_output` string array to tui.json that lists tool names whose output should always be shown (and expanded), even when the global generic tool output toggle is off. --- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx | 4 ++-- packages/opencode/src/config/tui-schema.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index fb62de9acf5f..fc13f8fd254b 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1579,7 +1579,7 @@ function GenericTool(props: ToolProps) { const { theme } = useTheme() const ctx = use() const output = createMemo(() => props.output?.trim() ?? "") - const [expanded, setExpanded] = createSignal(false) + const [expanded, setExpanded] = createSignal(ctx.tui?.show_tool_output?.includes(props.tool) ?? false) const lines = createMemo(() => output().split("\n")) const maxLines = 3 const overflow = createMemo(() => lines().length > maxLines) @@ -1590,7 +1590,7 @@ function GenericTool(props: ToolProps) { return ( {props.tool} {input(props.input)} diff --git a/packages/opencode/src/config/tui-schema.ts b/packages/opencode/src/config/tui-schema.ts index b126d3c96a42..ede7a26374ff 100644 --- a/packages/opencode/src/config/tui-schema.ts +++ b/packages/opencode/src/config/tui-schema.ts @@ -22,6 +22,10 @@ export const TuiOptions = z.object({ .enum(["auto", "stacked"]) .optional() .describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"), + show_tool_output: z + .array(z.string()) + .optional() + .describe("List of tool names whose output is always shown, even when generic tool output is hidden"), }) export const TuiInfo = z From 86d7c550741630251798c006910212b89bbb18b2 Mon Sep 17 00:00:00 2001 From: graelo Date: Tue, 31 Mar 2026 09:10:00 +0200 Subject: [PATCH 2/2] docs(tui): document show_tool_output config option --- packages/web/src/content/docs/tui.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/web/src/content/docs/tui.mdx b/packages/web/src/content/docs/tui.mdx index 010e8328f419..3006da3cb408 100644 --- a/packages/web/src/content/docs/tui.mdx +++ b/packages/web/src/content/docs/tui.mdx @@ -368,7 +368,8 @@ You can customize TUI behavior through `tui.json` (or `tui.jsonc`). "scroll_acceleration": { "enabled": true }, - "diff_style": "auto" + "diff_style": "auto", + "show_tool_output": ["bash", "read"] } ``` @@ -381,6 +382,7 @@ This is separate from `opencode.json`, which configures server/runtime behavior. - `scroll_acceleration.enabled` - Enable macOS-style scroll acceleration for smooth, natural scrolling. When enabled, scroll speed increases with rapid scrolling gestures and stays precise for slower movements. **This setting takes precedence over `scroll_speed` and overrides it when enabled.** - `scroll_speed` - Controls how fast the TUI scrolls when using scroll commands (minimum: `0.001`, supports decimal values). Defaults to `3`. **Note: This is ignored if `scroll_acceleration.enabled` is set to `true`.** - `diff_style` - Controls diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows a single-column layout. +- `show_tool_output` - List of tool names whose output is always shown and expanded, even when generic tool output is hidden. Useful for selectively surfacing output from specific tools (e.g. `["bash", "read"]`) while keeping others collapsed. Use `OPENCODE_TUI_CONFIG` to load a custom TUI config path.