Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ function GenericTool(props: ToolProps<any>) {
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)
Expand All @@ -1590,7 +1590,7 @@ function GenericTool(props: ToolProps<any>) {

return (
<Show
when={props.output && ctx.showGenericToolOutput()}
when={props.output && (ctx.showGenericToolOutput() || ctx.tui?.show_tool_output?.includes(props.tool))}
fallback={
<InlineTool icon="⚙" pending="Writing command..." complete={true} part={props.part}>
{props.tool} {input(props.input)}
Expand Down
4 changes: 4 additions & 0 deletions packages/opencode/src/config/tui-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packages/web/src/content/docs/tui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
```

Expand All @@ -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.

Expand Down
Loading