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 fb62de9acf5..fc13f8fd254 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 b126d3c96a4..ede7a26374f 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 diff --git a/packages/web/src/content/docs/tui.mdx b/packages/web/src/content/docs/tui.mdx index 010e8328f41..3006da3cb40 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.