[PR #17234] Fix cursor invalidation when line renditions are used #31165

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

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

State: closed
Merged: Yes


Summary of the Pull Request

When the renderer calculates the invalidate region for the cursor, it
needs to take the line rendition into account. But it was using a
relative coordinate rather than absolute coordinate when looking up the
line rendition for the row, so the calculated region could easily be
incorrect.

With this PR we now use the line rendition that was already being cached
in the CursorOptions structure, so we avoid needing to look it up
anyway. Similarly I've replaced the IsCursorDoubleWidth lookup with
the value that was already cached in the CursorOptions structure.

Validation Steps Performed

I've confirmed that the test case in issue #17226 is now working as
expected.

PR Checklist

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17234 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request When the renderer calculates the invalidate region for the cursor, it needs to take the line rendition into account. But it was using a relative coordinate rather than absolute coordinate when looking up the line rendition for the row, so the calculated region could easily be incorrect. With this PR we now use the line rendition that was already being cached in the `CursorOptions` structure, so we avoid needing to look it up anyway. Similarly I've replaced the `IsCursorDoubleWidth` lookup with the value that was already cached in the `CursorOptions` structure. ## Validation Steps Performed I've confirmed that the test case in issue #17226 is now working as expected. ## PR Checklist - [x] Closes #17226
claunia added the pull-request label 2026-01-31 09:45:31 +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#31165