Fix the Alternate Scroll Mode when DECCKM enabled #5081
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 bothDECCKM
modes.References
#3321
PR Checklist
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 bothDECCKM
modes.