[PR #3575] [MERGED] Terminal uses system default for number of rows scrolled at a time. Can be overridden in settings file. #25432

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3575
Author: @hannesne
Created: 11/14/2019
Status: Merged
Merged: 1/6/2020
Merged by: @miniksa

Base: masterHead: hannesne/configure_rows_scrolled


📝 Commits (10+)

  • 7bc8d46 Added 'rowsToScroll' setting in global settings, to configure the number of rows scrolled at a time. Default was hardcoded to 4. 1 works better on precision touchpads.
  • 0e3c5d2 Merge branch 'master' of https://github.com/hannesne/terminal into hannesne/configure_rows_scrolled
  • 0e3f086 Merge branch 'master' into hannesne/configure_rows_scrolled
  • b7dd11b Ran Invoke-CodeFormat
  • ad6f3ac Merge branch 'hannesne/configure_rows_scrolled' of https://github.com/hannesne/terminal into hannesne/configure_rows_scrolled
  • 20c8af0 Run code format
  • 7336711 Fixed whitespace in file for better diff in PR.
  • 37b408d Fixed whitespace in file for better diff in PR.
  • 5a3cd44 Terminal now uses system settings for number of lines to scroll if it's not overridden in settings.
  • d9bbe0d Terminal control will only grab system setting for lines to scroll on focus, not on every scroll event. More efficient.

📊 Changes

12 files changed (+68 additions, -6 deletions)

View changed files

📝 doc/cascadia/SettingsSchema.md (+1 -0)
📝 doc/cascadia/profiles.schema.json (+7 -0)
📝 src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp (+6 -2)
📝 src/cascadia/TerminalApp/GlobalAppSettings.cpp (+16 -0)
📝 src/cascadia/TerminalApp/GlobalAppSettings.h (+2 -0)
📝 src/cascadia/TerminalControl/TermControl.cpp (+6 -4)
📝 src/cascadia/TerminalControl/TermControl.h (+2 -0)
📝 src/cascadia/TerminalSettings/ICoreSettings.idl (+2 -0)
📝 src/cascadia/TerminalSettings/TerminalSettings.cpp (+20 -0)
📝 src/cascadia/TerminalSettings/terminalsettings.h (+3 -0)
📝 src/cascadia/UnitTests_TerminalCore/MockTermSettings.h (+2 -0)
📝 src/inc/DefaultSettings.h (+1 -0)

📄 Description

The terminal will use the system setting to determine the number of lines to scroll at a time.
This can be overridden by adding rowsToScroll to app global settings file.
terminal will use the system setting if the app setting is 0, or not specified. No restart is needed to reflect setting changes in system or the settings file.

The default was hardcoded to 4 in the code with a todo comment. 1 works better on precision touchpads, where 4 scrolls too fast.

  • 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: #xxx

Validation Steps Performed

  1. Launch terminal
  2. cat a large file so that there are many lines to scroll in between.
  3. Launch settings editor.
  4. Add rowsToScroll: 1 to global settings, and save the file.
  5. Scroll the page, it should now go nice and slow.
  6. Change the setting to 20, and save the file.
  7. Scrolling should now be super fast.
  8. Restart the terminal, and verify that scrolling is still super fast.
  9. Set rowsToScroll to 0 in settings and save the file.
  10. Verify that scrolling happens at system setting.
  11. Change system setting to max and switch focus back to terminal to see scrolling happen very fast.
  12. Change system setting to minimum and see scrolling happen very slow.

Example of profiles.json file:


// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "rowsToScroll": 1,

    "profiles":
    [
        {
            // Make changes here to the powershell.exe profile
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell",
            "commandline": "powershell.exe",
            "hidden": false
        },
        {
            // Make changes here to the cmd.exe profile
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",
            "hidden": false
        },
        {
            "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
            "hidden": false,
            "name": "PowerShell Core",
            "source": "Windows.Terminal.PowershellCore"
        },
        {
            "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "hidden": false,
            "name": "Ubuntu-18.04",
            "source": "Windows.Terminal.Wsl"
        }
    ],

    // Add custom color schemes to this array
    "schemes": [],

    // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": []
}


🔄 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/3575 **Author:** [@hannesne](https://github.com/hannesne) **Created:** 11/14/2019 **Status:** ✅ Merged **Merged:** 1/6/2020 **Merged by:** [@miniksa](https://github.com/miniksa) **Base:** `master` ← **Head:** `hannesne/configure_rows_scrolled` --- ### 📝 Commits (10+) - [`7bc8d46`](https://github.com/microsoft/terminal/commit/7bc8d4657aab8e4538a77cf3a93d1cad6a1ec2b5) Added 'rowsToScroll' setting in global settings, to configure the number of rows scrolled at a time. Default was hardcoded to 4. 1 works better on precision touchpads. - [`0e3c5d2`](https://github.com/microsoft/terminal/commit/0e3c5d21ef26abc44112b3d2ae4094d63bc3f94f) Merge branch 'master' of https://github.com/hannesne/terminal into hannesne/configure_rows_scrolled - [`0e3f086`](https://github.com/microsoft/terminal/commit/0e3f0866049d668a1d10c928627005f3ddb610b5) Merge branch 'master' into hannesne/configure_rows_scrolled - [`b7dd11b`](https://github.com/microsoft/terminal/commit/b7dd11ba6968bfbaa934faf1273fe033154d52c9) Ran Invoke-CodeFormat - [`ad6f3ac`](https://github.com/microsoft/terminal/commit/ad6f3acdbabbc5dc6506482a2625c757a77045df) Merge branch 'hannesne/configure_rows_scrolled' of https://github.com/hannesne/terminal into hannesne/configure_rows_scrolled - [`20c8af0`](https://github.com/microsoft/terminal/commit/20c8af0031385dd0e5bb3f9acac59a0d7f6075eb) Run code format - [`7336711`](https://github.com/microsoft/terminal/commit/73367115791796a0d3a576f1bfdd4b9e212e039f) Fixed whitespace in file for better diff in PR. - [`37b408d`](https://github.com/microsoft/terminal/commit/37b408d3ca57bc0b9236a3c03b55d18dd985d4cf) Fixed whitespace in file for better diff in PR. - [`5a3cd44`](https://github.com/microsoft/terminal/commit/5a3cd445ba6b6f6037a6a4e4b42eec64b4a12bfb) Terminal now uses system settings for number of lines to scroll if it's not overridden in settings. - [`d9bbe0d`](https://github.com/microsoft/terminal/commit/d9bbe0da906bb0b0e5e5d9a371976ba0db1a9621) Terminal control will only grab system setting for lines to scroll on focus, not on every scroll event. More efficient. ### 📊 Changes **12 files changed** (+68 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/SettingsSchema.md` (+1 -0) 📝 `doc/cascadia/profiles.schema.json` (+7 -0) 📝 `src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp` (+6 -2) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.cpp` (+16 -0) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.h` (+2 -0) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+6 -4) 📝 `src/cascadia/TerminalControl/TermControl.h` (+2 -0) 📝 `src/cascadia/TerminalSettings/ICoreSettings.idl` (+2 -0) 📝 `src/cascadia/TerminalSettings/TerminalSettings.cpp` (+20 -0) 📝 `src/cascadia/TerminalSettings/terminalsettings.h` (+3 -0) 📝 `src/cascadia/UnitTests_TerminalCore/MockTermSettings.h` (+2 -0) 📝 `src/inc/DefaultSettings.h` (+1 -0) </details> ### 📄 Description The terminal will use the system setting to determine the number of lines to scroll at a time. This can be overridden by adding rowsToScroll to app global settings file. terminal will use the system setting if the app setting is 0, or not specified. No restart is needed to reflect setting changes in system or the settings file. The default was hardcoded to 4 in the code with a todo comment. 1 works better on precision touchpads, where 4 scrolls too fast. * [ ] 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: #xxx ## Validation Steps Performed 1. Launch terminal 2. cat a large file so that there are many lines to scroll in between. 3. Launch settings editor. 4. Add rowsToScroll: 1 to global settings, and save the file. 5. Scroll the page, it should now go nice and slow. 6. Change the setting to 20, and save the file. 7. Scrolling should now be super fast. 8. Restart the terminal, and verify that scrolling is still super fast. 9. Set rowsToScroll to 0 in settings and save the file. 10. Verify that scrolling happens at system setting. 11. Change system setting to max and switch focus back to terminal to see scrolling happen very fast. 12. Change system setting to minimum and see scrolling happen very slow. Example of profiles.json file: ```json // To view the default settings, hold "alt" while clicking on the "Settings" button. // For documentation on these settings, see: https://aka.ms/terminal-documentation { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "rowsToScroll": 1, "profiles": [ { // Make changes here to the powershell.exe profile "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false }, { // Make changes here to the cmd.exe profile "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "cmd", "commandline": "cmd.exe", "hidden": false }, { "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "hidden": false, "name": "PowerShell Core", "source": "Windows.Terminal.PowershellCore" }, { "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", "hidden": false, "name": "Ubuntu-18.04", "source": "Windows.Terminal.Wsl" } ], // Add custom color schemes to this array "schemes": [], // Add any keybinding overrides to this array. // To unbind a default keybinding, set the command to "unbound" "keybindings": [] } ``` --- <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:09:28 +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#25432