Repository navigation
Conversation
The check for whether a wrap happens on its own read as `(chars && wide) ? a : b`, so a wrapped row starting with an empty cell counted as a natural wrap. The serializer then wrote that cell as a cursor move, which doesn't wrap, and the replay overwrote the end of the row above. Now an empty first cell always forces the wrap. Fixes xtermjs#6230
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 #6230
_rowEnddecides whether the next row's wrap happens on its own, which needs a character to be printed. The check readwhich parses as
(chars && wide) ? a : b. When the wrapped row starts with an empty cell and the row above is full, it fell through tothis._nullCellCount <= 0and passed. The serializer then wrote the empty cell asCSI 1 C, which doesn't wrap, so the replay printed the rest of the row over the last cell of the row above.The fix adds the parentheses the comment above it describes, so an empty first cell always takes the forced wrap path (
-,CSI 1 D,CSI 1 X). Cases with a printed first cell are unchanged.For the repro in the issue, the frame goes from
abcdefghij\x1b[1CYZ\x1b[3Dtoabcdefghij-\x1b[1D\x1b[1X\x1b[1CYZ\x1b[3D, and the replay matches the source, wrap flag included.Testing:
handle wrapped row starting with empty cell, usingtestNormalScreenEqual. It fails on master and passes with the fix.addon-serializeintegration suite on Chromium: 41 passed. I didn't run Firefox or WebKit locally.npm run test-unit: 2403 passing.npm run lint-changesis clean.This is independent of the fix for #6231 in the same function. The two branches merge cleanly in either order.