GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared): preserve progress redraws inside color sequences by StiensWout · Pull Request #44488 · pingdotgg/t3code

Conversation

@StiensWout

@StiensWout StiensWout commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Open the web app built from this main.
  2. Start a new thread and ask the agent to run printf 'abc\033[\r31mX'.
  3. 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.

Before After
Commit 1ac335f23b d5880821a9
Result failed with "expected 'abcX' to be 'Xbc'" passed

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.

All reactions
StiensWout and others added 8 commits November 27, 2026 23:23
@StiensWout @codex
test(shared): reproduce a redraw inside a color sequence
1ac335f
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(shared): preserve progress redraws inside color sequences
9369c3b
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
test(shared): cover redraws before an escape introducer
7404c06
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(shared): apply redraw controls before escape introducers
65e9687
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
refactor(shared): keep the line-control helper's original name
9235169
Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @claude
refactor(shared): reuse escapeLength instead of rewriting it as escap…
90c878a
…eEnd

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @codex
test(shared): cover bells interleaved with progress redraws
2f5184a
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(shared): preserve command redraws across terminal bells
d588082
Co-authored-by: GPT 6.2 Sol <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 61808c6
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39deff3f-6acc-4402-bdb6-9c3d5a7bb223
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 27, 2026
juliusmarminge and others added 2 commits November 27, 2026 22:39
@juliusmarminge
Merge remote-tracking branch 'origin/main' into wf/find-cfb422444b0ae…
729e20c
…3a610e3bf83
@juliusmarminge @claude
test(shared): fold escape redraw cases into the terminal output suite
67044a0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 27, 2026

Copy link
Copy Markdown
Member

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.

  1. Run printf 'abc\033[\r31mX'.
  2. 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 Before: uncolored abcX After: red X overwrites a, displaying Xbc
CR immediately after ESC ![Before: color parameters leak as abc31mX After: preserved color sequence and red Xbc

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 27, 2026
@juliusmarminge
juliusmarminge merged commit 264bb3b into pingdotgg:main Nov 27, 2026
60 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 27, 2026
@StiensWout
StiensWout deleted the wf/find-cfb422444b0ae3a610e3bf83 branch November 28, 2026 07:31
@omegent-app omegent-app Bot mentioned this pull request Nov 28, 2026
Merge upstream main through 0f78747290a1 patroza/t3code#688
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

Projects

None yet

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.

2 participants

@StiensWout @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.