fix(tui): normalize shell progress output#37710
Open
opencode-agent[bot] wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix agent-invoked shell commands whose progress output is separated by carriage returns (
\r), such asgit worktree add.The V2 agent shell card already has the V1-style 10-line collapsed preview and click-to-expand interaction. The discrepancy was that V2 passed raw carriage returns into
collapseToolOutput, which counts newline-delimited rows. OpenTUI rendered each carriage-return frame as a visible row, but the collapse logic saw one line and could let the entire progress stream fill the viewport.This normalizes CRLF and bare CR to
\nbefore applying the existing shell preview, for both completed and background shell output. The final PR diff does not change user-invoked shell messages.Verification
bun typecheckinpackages/tuibun test test/cli/tui/collapse-tool-output.test.tsinpackages/tui(2 passing)origin/v2: all 30 frames flood the cardRequested by: @rekram1-node (Aiden Cline via Slack)