[PR #13607] AtlasEngine: Fix LRU state after scrolling #29652

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

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

State: closed
Merged: Yes


66f4f9d had another bug: Just like how we scroll our viewport by memmoveing
the _r.cells array, we also have to memmove the new _r.cellGlyphMapping.
Without this fix drawing lots of glyphs while only scrolling slightly
(= not invalidating the entire viewport), would erroneously call
makeNewest on glyphs now outside of the viewport. This would cause
actually visible glyphs to be recycled and overwritten by new ones.

Validation Steps Performed

  • Switch to Cascadia Code
  • Print some text that fills the glyph atlas
  • Scroll down by a few rows
  • Write a long "==========" ligature (this quickly fills up
    any remaining space in the atlas and exacerbates the issue)
  • Unrelated rows don't get corrupted
**Original Pull Request:** https://github.com/microsoft/terminal/pull/13607 **State:** closed **Merged:** Yes --- 66f4f9d had another bug: Just like how we scroll our viewport by `memmove`ing the `_r.cells` array, we also have to `memmove` the new `_r.cellGlyphMapping`. Without this fix drawing lots of glyphs while only scrolling slightly (= not invalidating the entire viewport), would erroneously call `makeNewest` on glyphs now outside of the viewport. This would cause actually visible glyphs to be recycled and overwritten by new ones. ## Validation Steps Performed * Switch to Cascadia Code * Print some text that fills the glyph atlas * Scroll down by a few rows * Write a long "==========" ligature (this quickly fills up any remaining space in the atlas and exacerbates the issue) * Unrelated rows don't get corrupted ✅
claunia added the pull-request label 2026-01-31 09:36:08 +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#29652