[PR #4901] Don't draw the cursor if it's outside the viewport #26014

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

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

State: closed
Merged: Yes


Summary of the Pull Request

This changes the renederer to make sure to not draw the cursor when it is placed outside the viewport. When the window height isn't an exact multiple of a row's height, then there's a little bit of space below the last line we're actually drawing. If cursor is on the line below the viewport, then it can actually get drawn into this space. Since we're not drawing the text for that line, this is a little odd.

This PR fixes the issue by simply ensuring the cursor is in the veiwport before we draw it.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Checked with the GDI renderer as well as the DX renderer in conhost to make sure this is fixed for both of them, as well as the Terminal

**Original Pull Request:** https://github.com/microsoft/terminal/pull/4901 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This changes the renederer to make sure to not draw the cursor when it is placed outside the viewport. When the window height isn't an exact multiple of a row's height, then there's a little bit of space below the last line we're actually drawing. If cursor is on the line below the viewport, then it can actually get drawn into this space. Since we're not drawing the text for that line, this is a little odd. This PR fixes the issue by simply ensuring the cursor is in the veiwport before we draw it. ## References ## PR Checklist * [x] Closes #3166 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed Checked with the GDI renderer as well as the DX renderer in conhost to make sure this is fixed for both of them, as well as the Terminal
claunia added the pull-request label 2026-01-31 09:13:21 +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#26014