[PR #1523] [MERGED] Scroll from selection dragging out of window (#1247) #24619

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/1523
Author: @mcpiroman
Created: 6/24/2019
Status: Merged
Merged: 7/24/2019
Merged by: @miniksa

Base: masterHead: 1247-offscreen-scrolling


📝 Commits (10+)

  • 8078faf Scroll from selection dragging out of window
  • 45a48b3 Review changes, dynamic dt measurement, function separation
  • b222607 Fix formatting
  • d1623aa doc: fix some punctuation in README.md (#1512)
  • aa2f5f5 Make the about dialog's contents selectable (#1452)
  • 4676618 Set the default startup project (#1314)
  • 4eefdcc Add a fallback to software rendering (#1263)
  • a428484 Connect clipboard functionality to their keybindings (#1093)
  • 1c60e84 Apply a GDI region to the top level Island window to allow dragging with a single Island (#929)
  • 1efcf04 Add feature to ColorTool to write color scheme as JSON for Windows Terminal (issue #986) (#1052)

📊 Changes

2 files changed (+176 additions, -9 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+163 -8)
📝 src/cascadia/TerminalControl/TermControl.h (+13 -1)

📄 Description

Summary of the Pull Request

When user is mouse selecting and cursor wents out of viewport, terminal now scrolls down or up to 'follow' the cursor and expands selection. Additionally, when scrolling with mouse wheel while selecting, selection now updates immediately (instead of on next mouse move event).

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • Scrolling occures smoothly, i.e. you don't have to 'wave' the mouse to speed up scrolling as it is in conhost. The speed of scroll is determined by quadratic function. I tried to immitiate the browser's behaviour.
  • Scrollbar update occures at fixed 30 times/sec interval and is handled by DispatcherTimer. Idk if it's prefered solution but I'm not aware of better one.

Validation steps

  • Overfill visible buffer.
  • Start selection and move cursor below and above window, at diffrenet distances.
  • Start selection and scroll by mouse wheel without moving cursor.

🔄 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/1523 **Author:** [@mcpiroman](https://github.com/mcpiroman) **Created:** 6/24/2019 **Status:** ✅ Merged **Merged:** 7/24/2019 **Merged by:** [@miniksa](https://github.com/miniksa) **Base:** `master` ← **Head:** `1247-offscreen-scrolling` --- ### 📝 Commits (10+) - [`8078faf`](https://github.com/microsoft/terminal/commit/8078faf874b504af23d0823628cc65b67ff274df) Scroll from selection dragging out of window - [`45a48b3`](https://github.com/microsoft/terminal/commit/45a48b3c3e1a4239f8939806a0b05c7de7487424) Review changes, dynamic dt measurement, function separation - [`b222607`](https://github.com/microsoft/terminal/commit/b222607d15ccb56fdd2d819f002e6df1b8e88248) Fix formatting - [`d1623aa`](https://github.com/microsoft/terminal/commit/d1623aa05a41dbe3b57f880e7a54d3d2d9f06ebf) doc: fix some punctuation in README.md (#1512) - [`aa2f5f5`](https://github.com/microsoft/terminal/commit/aa2f5f52d5462797fdfc87b1042953bf35eb9fd7) Make the about dialog's contents selectable (#1452) - [`4676618`](https://github.com/microsoft/terminal/commit/4676618d0c23bee78a6c423f76426563cc138d55) Set the default startup project (#1314) - [`4eefdcc`](https://github.com/microsoft/terminal/commit/4eefdcc9019ed854cd0182872216c44f992261a0) Add a fallback to software rendering (#1263) - [`a428484`](https://github.com/microsoft/terminal/commit/a428484c6792cfa7ff73e39361784e35b925c21b) Connect clipboard functionality to their keybindings (#1093) - [`1c60e84`](https://github.com/microsoft/terminal/commit/1c60e84e8116de1a762c6b93e4ea3df5fecb569c) Apply a GDI region to the top level Island window to allow dragging with a single Island (#929) - [`1efcf04`](https://github.com/microsoft/terminal/commit/1efcf04e184e83de1973f552f506fcfa24578d72) Add feature to ColorTool to write color scheme as JSON for Windows Terminal (issue #986) (#1052) ### 📊 Changes **2 files changed** (+176 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+163 -8) 📝 `src/cascadia/TerminalControl/TermControl.h` (+13 -1) </details> ### 📄 Description ## Summary of the Pull Request When user is mouse selecting and cursor wents out of viewport, terminal now scrolls down or up to 'follow' the cursor and expands selection. Additionally, when scrolling with mouse wheel while selecting, selection now updates immediately (instead of on next mouse move event). <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] Closes #1247 * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #1247 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments - Scrolling occures smoothly, i.e. you don't have to 'wave' the mouse to speed up scrolling as it is in conhost. The speed of scroll is determined by quadratic function. I tried to immitiate the browser's behaviour. - Scrollbar update occures at fixed 30 times/sec interval and is handled by `DispatcherTimer`. Idk if it's prefered solution but I'm not aware of better one. ## Validation steps <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> - Overfill visible buffer. - Start selection and move cursor below and above window, at diffrenet distances. - Start selection and scroll by mouse wheel without moving cursor. --- <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:04:24 +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#24619