Skip to content

Fix SGR mouse movement reports #18864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
Merged

Conversation

j4james
Copy link
Collaborator

@j4james j4james commented May 2, 2025

According to the documentation, the final character of an SGR mouse
report is meant to be M for a button press and m for a button
release. However it isn't clear what the final character should be for
motion events, and we were using an m if there weren't any buttons
held down at the time, while all other terminals used an M, regardless
of the button state.

This PR updates our implementation to match what everyone else is doing,
since our interpretation of the spec was causing problems for some apps.

Validation Steps Performed

I've manually tested the new behavior in Vttest, and confirmed that our
mouse reports now match Xterm more closely, and I've tested with v0.42.0
of Zellij, which was previous glitching badly in Windows Terminal, but
now works correctly.

I've also updated our unit tests for the SGR mouse mode to reflect the
correct report format.

Closes #18712

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels completely correct. Thanks for maintaining our compatibilty and correctness :)

@DHowett
Copy link
Member

DHowett commented May 2, 2025

/azp run

@DHowett DHowett enabled auto-merge (squash) May 2, 2025 19:29
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DHowett DHowett closed this May 2, 2025
auto-merge was automatically disabled May 2, 2025 22:34

Pull request was closed

@DHowett DHowett reopened this May 2, 2025
@DHowett
Copy link
Member

DHowett commented May 2, 2025

I've tried to kick the CLA robot... let's see if it works?

@DHowett
Copy link
Member

DHowett commented May 2, 2025

IT WORKS

@DHowett DHowett enabled auto-merge (squash) May 2, 2025 22:35
@DHowett DHowett merged commit 865f5e5 into microsoft:main May 2, 2025
17 checks passed
@j4james j4james deleted the fix-sgr-mouse branch May 3, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Cherry Pick
Status: To Cherry Pick
Development

Successfully merging this pull request may close these issues.

Any-event SGR mouse reports are wrong
3 participants