You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Collapse long bash commands, and optionally show the output's tail #55420
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
In v1 a bash tool call's output collapses to 10 lines, but its command never does. A long command, or one with heredocs (python3 - <<'PY', cat > x.service <<'EOF', a SQL script fed to psql), takes as many rows as it has lines, so a few such calls fill the screen even when their output is folded away.
v2 (dev) already cuts the command to 2 rows and shows the output's tail under (N earlier lines), with both limits hardcoded (util/collapse-tool-output.ts, collapseShellOutput).
Proposal for v1, configurable and off by default:
tool_input.collapse in tui.json, shaped like tool_output.collapse (rows, 0 or "never", per group bash or per tool name): the command is cut after that many rendered rows, keeping its wrapping, and one click expands command and output together. Default "never", so nothing changes unless set.
tool_output.tail (per group bash/generic or tool name, default off): collapsed output shows its last lines under (N earlier lines), using v2's collapseTail, instead of its first.
The command and the output keep separate limits, so tool_output.collapse.bash still decides the output's lines.
This is AI generated, but under direct supervision and on request of @Nowaker.
This asks for a change to v1 (0.x/1.x). v1 now only gets fixes for critical bugs like data loss, security problems, or crashes and breakage with no workaround. New options like tool_input.collapse and tool_output.tail are unlikely to be added there.
As you noted, v2 (@opencode/cli) already does most of this. It cuts long shell commands, heredocs included, to a couple of rows and shows the output's tail under (N earlier lines). We'd encourage upgrading to v2. If you'd like those limits to be configurable in v2, a v2-focused request is welcome. These related issues may be relevant:
Closing this as not planned. It asks for new collapse options in v1, which only gets critical fixes, and we haven't heard that it's critical or also happens on v2.
v2 (@opencode/cli) already cuts long shell commands short and shows the output's tail under (N earlier lines), so upgrading should give you most of what you described. If you'd like those limits to be configurable in v2, please open a new v2 request (see also #51229 and #54039). Thanks again for the detailed write-up, @Nowaker!
Activity
opencode-agent commentedon Oct 14, 2026
Thanks for the detailed proposal, @Nowaker!
This asks for a change to v1 (0.x/1.x). v1 now only gets fixes for critical bugs like data loss, security problems, or crashes and breakage with no workaround. New options like
tool_input.collapseandtool_output.tailare unlikely to be added there.As you noted, v2 (
@opencode/cli) already does most of this. It cuts long shell commands, heredocs included, to a couple of rows and shows the output's tail under(N earlier lines). We'd encourage upgrading to v2. If you'd like those limits to be configurable in v2, a v2-focused request is welcome. These related issues may be relevant:If you think this is critical for v1, or you see the same problem on v2, please reply here.
opencode-agent commentedon Oct 15, 2026
Closing this as not planned. It asks for new collapse options in v1, which only gets critical fixes, and we haven't heard that it's critical or also happens on v2.
v2 (
@opencode/cli) already cuts long shell commands short and shows the output's tail under(N earlier lines), so upgrading should give you most of what you described. If you'd like those limits to be configurable in v2, please open a new v2 request (see also #51229 and #54039). Thanks again for the detailed write-up, @Nowaker!