GeezerVison is showing github.com — fix(shared): preserve progress redraws inside color sequences by StiensWout · Pull Request #44488 · pingdotgg/t3code
Conversation
Expanded command output could append progress redraws to stale text or print raw color parameters when a terminal control interrupted an escape sequence. The shared parser now applies carriage returns, newlines, and backspaces while preserving the escape across chunks, and consumes interleaved bells without interrupting the redraw.
Related: #42944, #40687, #43542, #34868, #41807
Reproduction on main
Commit f513ffe6f9 (main), in the running web app:
- Open the web app built from this main.
- Start a new thread and ask the agent to run printf 'abc\033[\r31mX'.
- Expand that command's output in the thread.
The output line reads abcX. Expected: The output line reads Xbc. The carriage return returns to the start of the line, and X replaces the first character.
The cause is at packages/shared/src/terminalOutput.ts:627. Ran cd packages/shared && pnpm exec vp test run src/terminalOutput.test.ts with the repro test added: it failed in 2 of 2 runs on a clean checkout, with expected 'abcX' to be 'Xbc' in the output.
Evidence
Environment: Linux x64, the repository's own tests.
Proven: the repro fails at the test commit 1ac335f23b and passes on the head d5880821a9, both on main 4fc1a84297.
Outside view: a person sees it in the running web app by following the steps under Reproduction on main.
Tests
- 1ac335f23b adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 4fc1a842971a7a24c8d3aeff53fe0e00abe3aad7 passed on head.
Not in this change
- A bell inside a terminal string still terminates the string.
- Client rendering uses the output produced by the shared parser.
Who did the work
- Repro written by GPT 6.2 Sol, in Codex
- Outside view by Grok 4.7, in Grok
- Written by GPT 6.2 Sol, in Codex
- Trimmed by Claude Opus 5.5, in Claude Code
- Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, and by Gemini 4 Neon, in Antigravity
- Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by GPT 6.2 Sol, Grok 4.7, Claude Opus 5.5 and Gemini 4 Neon
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Terminal parsing now applies line controls encountered around escape sequences. Tests cover these controls at every input split, including when parsing resumes from serialized state.
Changes: Terminal escape parsing
| Layer / File(s) |
Summary |
Control handling during escape parsing packages/shared/src/terminalOutput.ts, packages/shared/src/terminalOutput.test.ts |
Terminal.control applies line-control effects. Terminal.feed handles controls before and within escape sequences. Tests check output across input splits and saved-state resume. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: saphid
Merge Risk: Minimal · up to 67044
-
This change fixes progress redraws in expanded command output when line controls appear inside escape sequences. It is limited to the shared parser and its tests, and no merge-blocking risk is evident.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the fix and its scope: progress redraws inside color escape sequences, under the shared package. It matches the change that makes carriage returns, newlines, and backspaces apply withi… |
| Description check |
 |
The description states the problem, the change, and the reproduction steps with observed and expected output. It cites the failing test before the fix and the passing result on head, and it names the … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the fix and its scope: progress redraws inside color escape sequences, under the shared package. It matches the change that makes carriage returns, newlines, and backspaces apply within unfinished escape sequences, and it follows the conventional commit format.
Full details: Description check
-
Explanation
The description states the problem, the change, and the reproduction steps with observed and expected output. It cites the failing test before the fix and the passing result on head, and it names the scope limit (bells inside strings). It lists related issues and the tooling used. The template's Scope section asks for a linked bug issue, but the description links related issues only, does not state that it links the bug report, and does not say why no issue is needed. The Verification section gives focused test results and notes what was not checked. The template asks for an agent attribution at the end, and the description includes one.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between d588082 and 67044a0.
Files selected for processing: 1
-
packages/shared/src/terminalOutput.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Real web app, Chromium 156, 1280×800, light theme, fresh database per commit. OpenCode executed each command in a separate thread. Expanded Worked for and the printf row, then waited for command syntax highlighting before capturing.
- Run
printf 'abc\033[\r31mX'.
- Run
printf 'abc\033\r[31mX'.
The scenario runner exited 0: base failed and head passed. Both head outputs show Xbc with a red X; command syntax highlighting is complete on both sides.
| Case |
Before — 61808c68cf |
After — 67044a00e6 |
| CR inside CSI |
 |
 |
| CR immediately after ESC |
 |
Scenario source.
Not shown:
- Chunk-boundary splits and restored parser state were not separately exercised; these captures cover completed command output.
- LF, backspace, and BEL handling were not separately captured; both demonstrated paths use carriage return.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|