[PR #8379] Fix the xterm and SGR mouse encodings for CTRL, ALT, SHIFT #27182

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

Original Pull Request: https://github.com/microsoft/terminal/pull/8379

State: closed
Merged: Yes


We had the xterm and SGR codings for meta/ctrl backwards. Oops.

This commit also fixes an observed issue in Windows Terminal where we
were passing in a console-style modifiers enum when MouseInput is
expecting MK_ constants.

I decided to unify MouseInput around the console-style modifier
constants because they have support for META (which MK_ does not) and
can differentiate between left/right alt/ctrl.

Our tests are fundamentally flawed here: they use a copy of the
modifier key generating logic themselves, so we got a bit of "error
carried forward."

I did not fix the tests to use known-good control sequences, I simply
replaced the character generator with another copy of the modifier code.
I did, however, extend them to test ctrl|meta and left/right modifiers.

Fixes #8291

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8379 **State:** closed **Merged:** Yes --- We had the xterm and SGR codings for meta/ctrl backwards. Oops. This commit also fixes an observed issue in Windows Terminal where we were passing in a console-style modifiers enum when MouseInput is expecting MK_ constants. I decided to unify MouseInput around the console-style modifier constants because they have support for META (which MK_ does not) and can differentiate between left/right alt/ctrl. Our tests are fundamentally flawed here: they use a copy of the modifier key generating logic _themselves_, so we got a bit of "error carried forward." I did not fix the tests to use known-good control sequences, I simply replaced the character generator with another copy of the modifier code. I did, however, extend them to test ctrl|meta and left/right modifiers. Fixes #8291
claunia added the pull-request label 2026-01-31 09:20:29 +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#27182