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

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

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

State: closed
Merged: Yes


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.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/1523 **State:** closed **Merged:** Yes --- ## 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.
claunia added the pull-request label 2026-01-31 09:04:27 +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#24624