[PR #6062] Implement preventing auto-scroll on new output #26577

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Updates the Terminal's scroll response to new output. The Terminal will not automatically scroll if...

  • a selection is active, or
  • the viewport is at the bottom of the scroll history

References

#2529 - Spec
#3863 - Implementation

PR Checklist

Detailed Description of the Pull Request / Additional comments

Updates the _scrollOffset value properly in TerminalCore when the cursor moves. We calculate a new _scrollOffset based on if we are circling the buffer and how far below the mutable bottom is.

We specifically check for if a selection is active and if the viewport is at the bottom, then use that as a condition for deciding if we should update _scrollOffset to the new calculated value or 0 (the bottom of the scroll history).

Validation Steps Performed

Manual testing. Though I should add automated tests.

  • new output
  • new output when circling
  • new output when circling and viewport is at the top
**Original Pull Request:** https://github.com/microsoft/terminal/pull/6062 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Updates the Terminal's scroll response to new output. The Terminal will not automatically scroll if... - a selection is active, or - the viewport is at the bottom of the scroll history ## References #2529 - Spec #3863 - Implementation ## PR Checklist * [X] Closes #980 * [X] Closes #3863 * [ ] Tests added/passed * [ ] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments Updates the `_scrollOffset` value properly in TerminalCore when the cursor moves. We calculate a new `_scrollOffset` based on if we are circling the buffer and how far below the mutable bottom is. We specifically check for if a selection is active and if the viewport is at the bottom, then use that as a condition for deciding if we should update `_scrollOffset` to the new calculated value or 0 (the bottom of the scroll history). ## Validation Steps Performed Manual testing. Though I should add automated tests. - [X] new output - [X] new output when circling - [X] new output when circling and viewport is at the top
claunia added the pull-request label 2026-01-31 09:16:56 +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#26577