[PR #5081] [MERGED] Fix the Alternate Scroll Mode when DECCKM enabled #26092

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5081
Author: @j4james
Created: 3/23/2020
Status: Merged
Merged: 3/23/2020
Merged by: @undefined

Base: masterHead: fix-alternate-scroll


📝 Commits (2)

  • 547280f Send the appropriate application sequences for alternate scroll events when DECCKM mode is enabled.
  • b9f505a Add some unit tests for mouse wheel events in alternate scroll mode.

📊 Changes

2 files changed (+44 additions, -2 deletions)

View changed files

📝 src/terminal/adapter/ut_adapter/MouseInputTest.cpp (+40 -0)
📝 src/terminal/input/mouseInput.cpp (+4 -2)

📄 Description

Summary of the Pull Request

If the Alternate Scroll Mode is enabled, the terminal generates up/down keystrokes when the mouse wheel is scrolled. However, the expected escape sequences for those keys are dependent on the state of the Cursor Keys Mode ( DECCKM), but we haven't taken that into account. This PR updates the alternate scroll implementation to make sure the appropriate sequences are sent for both DECCKM modes.

References

#3321

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • 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

Detailed Description of the Pull Request / Additional comments

I've simply added a condition in the TerminalInput::_SendAlternateScroll method to send a different pair of sequences dependent on the state of _cursorApplicationMode flag.

Validation Steps Performed

Manually tested in VIM (although that required me enabling the Alternate Scroll Mode myself first). Also added a new unit test in MouseInputTest to confirm the correct sequences were generated for both DECCKM modes.


🔄 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/5081 **Author:** [@j4james](https://github.com/j4james) **Created:** 3/23/2020 **Status:** ✅ Merged **Merged:** 3/23/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `fix-alternate-scroll` --- ### 📝 Commits (2) - [`547280f`](https://github.com/microsoft/terminal/commit/547280f5279bd35ebe8e507bf0a3616c8cfeda74) Send the appropriate application sequences for alternate scroll events when DECCKM mode is enabled. - [`b9f505a`](https://github.com/microsoft/terminal/commit/b9f505a56520124afaf5865de46f2772da40e790) Add some unit tests for mouse wheel events in alternate scroll mode. ### 📊 Changes **2 files changed** (+44 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/adapter/ut_adapter/MouseInputTest.cpp` (+40 -0) 📝 `src/terminal/input/mouseInput.cpp` (+4 -2) </details> ### 📄 Description ## Summary of the Pull Request If the _Alternate Scroll Mode_ is enabled, the terminal generates up/down keystrokes when the mouse wheel is scrolled. However, the expected escape sequences for those keys are dependent on the state of the _Cursor Keys Mode_ ( `DECCKM`), but we haven't taken that into account. This PR updates the alternate scroll implementation to make sure the appropriate sequences are sent for both `DECCKM` modes. ## References #3321 ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be updated * [ ] 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 ## Detailed Description of the Pull Request / Additional comments I've simply added a condition in the `TerminalInput::_SendAlternateScroll` method to send a different pair of sequences dependent on the state of `_cursorApplicationMode` flag. ## Validation Steps Performed Manually tested in VIM (although that required me enabling the _Alternate Scroll Mode_ myself first). Also added a new unit test in `MouseInputTest` to confirm the correct sequences were generated for both `DECCKM` modes. --- <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:13:52 +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#26092