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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6062
Author: @carlos-zamora
Created: 5/21/2020
Status: Merged
Merged: 7/9/2020
Merged by: @undefined

Base: masterHead: dev/cazamor/snapOnOutput


📝 Commits (8)

  • d7061eb naive implementation (but it works)
  • 89bc4d5 add behavior for multiple flags
  • 287dd6b now this works with the circling buffer!
  • 6a4c4e3 remove my lazy enum approach
  • d092e39 update the schema
  • f7ba29b remove configurability
  • e0e8f37 merge master
  • 2b8c380 just use scrollOffset to detect if 'at bottom'

📊 Changes

1 file changed (+10 additions, -2 deletions)

View changed files

📝 src/cascadia/TerminalCore/Terminal.cpp (+10 -2)

📄 Description

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

🔄 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/6062 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 5/21/2020 **Status:** ✅ Merged **Merged:** 7/9/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/cazamor/snapOnOutput` --- ### 📝 Commits (8) - [`d7061eb`](https://github.com/microsoft/terminal/commit/d7061ebfaa85ccf94fabaeddc8e5a216a09dcb3c) naive implementation (but it works) - [`89bc4d5`](https://github.com/microsoft/terminal/commit/89bc4d53cd41ab872c487547e5bf6a653e278ee5) add behavior for multiple flags - [`287dd6b`](https://github.com/microsoft/terminal/commit/287dd6b4edc0f43d65b6ad9410a17a5f08bfacaf) now this works with the circling buffer! - [`6a4c4e3`](https://github.com/microsoft/terminal/commit/6a4c4e3f2c2bc45376965577a271cce6a8d16c19) remove my lazy enum approach - [`d092e39`](https://github.com/microsoft/terminal/commit/d092e39b1d7be1a46f42a7510eb605c1538422eb) update the schema - [`f7ba29b`](https://github.com/microsoft/terminal/commit/f7ba29bfca32490c47ab9dfc19dcd5be5f59a8d4) remove configurability - [`e0e8f37`](https://github.com/microsoft/terminal/commit/e0e8f37d76b8d930ded97b39d98d4c8ca817cd38) merge master - [`2b8c380`](https://github.com/microsoft/terminal/commit/2b8c38068c64bd04f5330fa851b31279d16df20d) just use scrollOffset to detect if 'at bottom' ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+10 -2) </details> ### 📄 Description ## 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 --- <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:16:53 +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#26572