[PR #10749] [MERGED] Fix text selection while new lines are being printed when history buffer is full #28204

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10749
Author: @PankajBhojwani
Created: 7/21/2021
Status: ✅ Merged
Merged: 8/20/2021
Merged by: @undefined

Base: main ← Head: dev/pabhoj/scroll_select_fix


📝 Commits (10+)

📊 Changes

3 files changed (+107 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalCore/Terminal.cpp (+25 -0)
📝 src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp (+78 -0)
📝 src/renderer/base/renderer.cpp (+4 -0)

📄 Description

When our text buffer is full, newlines cause the buffer to scroll underneath the viewport (rather than the viewport moving down). This was causing selections made during text output to scroll down. To solve this, when we increment the circular buffer, we decrement the y-coordinates of the current selections by 1. We also invalidate the previous selection rects.

Closes #10319


🔄 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/10749 **Author:** [@PankajBhojwani](https://github.com/PankajBhojwani) **Created:** 7/21/2021 **Status:** ✅ Merged **Merged:** 8/20/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/pabhoj/scroll_select_fix` --- ### 📝 Commits (10+) - [`65f3c95`](https://github.com/microsoft/terminal/commit/65f3c9508cad069d586e11b6ea8b31710680c423) invalidate old selections - [`0448533`](https://github.com/microsoft/terminal/commit/0448533fff672904ec55ad573fe9f3d30e2a27a2) fix - [`e350ff2`](https://github.com/microsoft/terminal/commit/e350ff2507d1cd272fd6d008fa61c62ec0b8529c) noexcept, mockrenderdata - [`c5860fe`](https://github.com/microsoft/terminal/commit/c5860fe4d845b33a22f8aa90569b5ea7c2d216b2) noexcept - [`e8ab28d`](https://github.com/microsoft/terminal/commit/e8ab28df7a05c37d3de0565f8701c2aa46c97b71) don't go to renderer - [`55e8802`](https://github.com/microsoft/terminal/commit/55e88025d3e8fea296c4b434ca09e9953b548d1b) scroll off screen case - [`2db3b6c`](https://github.com/microsoft/terminal/commit/2db3b6ca59d55aef061a57f9d3ef16ceb410ccc4) start.X - [`72f2975`](https://github.com/microsoft/terminal/commit/72f297598a3e1807a170bca4f137db48ba1ca2ff) Merge branch 'main' of https://github.com/microsoft/terminal into dev/pabhoj/scroll_select_fix - [`bb8831d`](https://github.com/microsoft/terminal/commit/bb8831de652ac68ae22b1459b83fa02342bb628c) add test - [`daa4c0b`](https://github.com/microsoft/terminal/commit/daa4c0baad2720c5003ae4fbca44bb3c0d9bb9d2) test fixes ### 📊 Changes **3 files changed** (+107 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+25 -0) 📝 `src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp` (+78 -0) 📝 `src/renderer/base/renderer.cpp` (+4 -0) </details> ### 📄 Description When our text buffer is full, newlines cause the buffer to scroll underneath the viewport (rather than the viewport moving down). This was causing selections made during text output to scroll down. To solve this, when we increment the circular buffer, we decrement the y-coordinates of the current selections by 1. We also invalidate the previous selection rects. Closes #10319 --- <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:27:00 +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#28204