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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4901
Author: @zadjii-msft
Created: 3/13/2020
Status: ✅ Merged
Merged: 3/13/2020
Merged by: @undefined

Base: master ← Head: dev/migrie/b/3166-cursor-turds-2020


📝 Commits (2)

  • 933870e this definitely works, but I want to check the if as well
  • b190219 Yea, this definitely does ficx #3166

📊 Changes

1 file changed (+28 additions, -19 deletions)

View changed files

📝 src/renderer/base/renderer.cpp (+28 -19)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4901 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 3/13/2020 **Status:** ✅ Merged **Merged:** 3/13/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/b/3166-cursor-turds-2020` --- ### 📝 Commits (2) - [`933870e`](https://github.com/microsoft/terminal/commit/933870e1611d1cd1279741179411722d1ef680df) this definitely works, but I want to check the `if` as well - [`b190219`](https://github.com/microsoft/terminal/commit/b1902191e0cfa108ed239ebaf22d2ddcc6c0e977) Yea, this definitely does ficx #3166 ### 📊 Changes **1 file changed** (+28 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/base/renderer.cpp` (+28 -19) </details> ### 📄 Description ## 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:13:19 +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#26009