[PR #12853] Fix DBCS attribute corruption during reflow #29273

Open
opened 2026-01-31 09:33:52 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/12853

State: closed
Merged: Yes


855e136 contains a regression which breaks buffer reflow if wide surrogate
characters are present. This happens because we made use of the
TextBufferCellIterator whose increment operator skips 2 cells for wide
characters. This created a "misalignment" in the reflow logic which was written
for cell-wise iteration. This commit fixes the issue, by reverting back to the
previous algorithm without iterators.

Closes #12837
Closes MSFT-38904421

Validation Steps Performed

  • Run pwsh -noprofile -command echo "`u{D83D}`u{DE43}"
  • Resizing conhost preserves all contents
  • Resizing Windows Terminal doesn't crash it
  • Added a test covering this issue
**Original Pull Request:** https://github.com/microsoft/terminal/pull/12853 **State:** closed **Merged:** Yes --- 855e136 contains a regression which breaks buffer reflow if wide surrogate characters are present. This happens because we made use of the `TextBufferCellIterator` whose increment operator skips 2 cells for wide characters. This created a "misalignment" in the reflow logic which was written for cell-wise iteration. This commit fixes the issue, by reverting back to the previous algorithm without iterators. Closes #12837 Closes MSFT-38904421 ## Validation Steps Performed * Run ``pwsh -noprofile -command echo "`u{D83D}`u{DE43}"`` * Resizing conhost preserves all contents ✅ * Resizing Windows Terminal doesn't crash it ✅ * Added a test covering this issue ✅
claunia added the pull-request label 2026-01-31 09:33:52 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29273