Repository navigation
terminal: reset style before VT replay of blank cells - #246
Conversation
A styled cell followed by skipped default cells replays the blanks with the previous cell's background. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The formatter wrote accumulated blank cells as spaces before it switched to the next cell's style, so the spaces took the previous cell's colors. Claude Code's mascot sets a black background and skips three cells with CHA, which a cmux Cloud replay painted as a black box. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPageFormatter now resets active non-default styling before emitting accumulated blank cells. A regression test checks that three unstyled spaces follow an SGR reset after text with a black background. ChangesBlank-cell formatting
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The formatter now emits pending blank cells without inheriting the prior style, and the regression test checks the reset ordering. No actionable merge-blocking risk is evident. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The VT formatter counted unstyled blank cells and wrote them as spaces just before the next non-blank cell, but it wrote them before it switched to that cell's style. The spaces took the previous cell's colors.
Claude Code draws its mascot with
ESC[48;2;0;0;0m(black background) and then jumps over three untouched cells withESC[12GbeforeESC[49m. A live terminal leaves those cells empty. A cmux Cloud replay (cmux-tuivt_replaythrough libghostty-vt) painted them as a black box next to the mascot.The fix closes a non-default style before writing the pending blanks, the same way the row-break path already does. Plain output is unchanged.
Commits:
2439e8e7cadds the failing testPage VT unstyled blank cells do not inherit the previous background,51c8da0ceadds the fix.Verification on a Blacksmith Testbox (Linux, Zig 0.16.0):
zig build test-lib-vt -Dtest-filter='Page VT'fails at the test commit (AB ESC[0mC) and passes at the fix commit. Fulltest-lib-vthas one failure,kitty temporary file medium preserves bool ABI, which also fails at basee1b8bf5f4. cmux-tuicargo testpasses except one mouse-capture test that passes when run alone.Upstream ghostty-org/ghostty has the same code; upstreaming is a maintainer decision.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the VT formatter writing blank cells with the previous cell's colors, which could paint a black box in replays after Claude Code's mascot output.
The formatter now closes an open non-default style before emitting accumulated blank spaces, matching the row-break path. Plain output is unchanged, and a regression test covers a styled cell followed by skipped default cells.
Written for commit 51c8da0. Summary will update on new commits.
Summary by CodeRabbit