Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Summary
In v2, the TUI already shortens a shell tool call: the command is cut to a fixed number of rows and the output shows its tail under (N earlier lines). Both limits are hardcoded, and there is no cli.json setting to change them. I'd like to make them configurable, including down to a single row for the command and a minimal output preview.
This follows the maintainer reply on #55420 ("If you'd like those limits to be configurable in v2, please open a new v2 request"). Related: #40096, #51229.
Environment
- opencode version: v2.2.0
- OS: Darwin 27.0.0 (arm64)
- Terminal: Ghostty (TERM_PROGRAM=ghostty, COLORTERM=truecolor)
- Shell: /bin/zsh
- Install/channel: latest
- Active plugins: one local TUI plugin (
git-status, footer/status only; does not touch tool rendering)
Use case
I chain several commands in one tool call (cd ... && sed -n ...; cat ...; sed -n ...). In the full TUI that call takes several rows for the command, plus a tail of the output. In long sessions these blocks dominate the transcript and make it hard to follow the conversation. I would like a compact form: the command on one row and little or no output, with click-to-expand for details.
Proposal
Add settings under session in cli.json, for example:
{
"session": {
"tools": {
"shell": {
"command_rows": 1,
"output_rows": 0,
"output_tail": true
}
}
}
}command_rows: number of rendered rows of the command to show before truncating. The current hardcoded value would be the default.output_rows: number of output lines to show.0would show only a summary like(N lines). The current hardcoded value would be the default.output_tail: show the last lines (current behavior) or the first lines.- Clicking the block still expands it fully.
Defaults would preserve current behavior, so nothing changes unless set. A per-tool-name override (for other tools such as read/grep/generic) would be a natural extension.
What I tried
session.grouping: "none",mini.*settings: no setting touches the length of a single shell block (miniis a different interface).- The
session.verbosity.cyclekeybind (unbound by default and undocumented): cycling it did not shorten the shell block in my testing. - TUI plugin API (https://opencode.ai/v2/docs/build/plugins/cli): exposes slots, commands, panels and code-block renderers, but no hook for rendering tool-call blocks.
Additional Context
- Docs consulted: https://opencode.ai/v2/docs/cli/config and https://opencode.ai/v2/docs/cli/keybinds
- Maintainers mention the hardcoded limits live in
util/collapse-tool-output.ts(collapseShellOutput).
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the clear write-up, @JoakimStauStald! In short, you'd like
cli.jsonsettings for how many rows a shell tool block shows for the command and for the output (head or tail), with0meaning a summary only. Defaults would stay as they are, and clicking would still expand the block.You're right that these limits are hardcoded in v2 right now. The shell block uses a 10-line budget, and
collapseShellOutputinpackages/tui/src/util/collapse-tool-output.tscaps the command at 2 rows and shows the output's tail in what's left. Nothing in the config changes this yet. The TUI plugin API also has no hook for rendering tool blocks, so a plugin can't do it for now either.Maintainers will consider the request. Related issues: