Repository navigation
Conversation
A buffer line can be longer than the grid. After a column shrink on the alt buffer, every line keeps its old length (xtermjs#6228). The row walk went to line.length, so the frame carried cells the grid no longer has. The forced wrap separator also read the row's last cells and built its cleanup moves from line.length, so a replay left '-' filler on screen. Clamp the row walk and the separator to terminal.cols. serializeAsHTML shares the row walk, so its rows stop at cols too. Fixes xtermjs#6229 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #6229
Summary
BaseSerializeHandler.serializetoterminal.colsStringSerializeHandler._rowEndtoterminal.colsas well: its reads of the row's last two cells and its forced wrap cleanup moves_terminalintoBaseSerializeHandlerso the shared row walk can readcolsProblem
A buffer line can be longer than the grid. After a column shrink on the alt buffer, every line keeps its old length (#6228). The serializer walked each row to
line.length, so a frame carried cells the grid no longer has and a replay at the current width garbled rows._rowEndalso read the row's last cells and built the moves that erase its-wrap filler fromline.length, so the filler stayed on screen.Fix
Each row stops at
Math.min(line.length, terminal.cols), and_rowEnduses the same length.serializeAsHTMLshares the row walk, so its rows stop atcolstoo.Buffer.resizeis untouched. #6228 tracks that gap. Clamping in the addon keeps frames on the grid for any path that leaves a line longer thancols.Test plan
lines longer than cols: a replay of the SerializeAddon serializes cells past terminal.cols when a line is longer than the grid #6229 repro, and a row ending in empty cells above an autowrapped row, which exercises the separator's cleanup movescolsserializescolscellsmaster, and the separator test still fails with only the row walk clampedaddons/addon-serialize/src/SerializeAddon.test.ts: 47 passingnpm run tscandnpm run lintpassThe tests reach a long line through the alt buffer gap in #6228. Once that is fixed they still pass, but they no longer exercise the clamp.
🤖 Generated with Claude Code