[PR #5375] wpf: add support for VT mouse mode #26290

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

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

State: closed
Merged: Yes


Summary of the Pull Request

This pull request ports the VT mouse code from TermControl to WpfTerminalControl. Our WPF control is a lot closer to Win32 than to Xaml, so our mouse event handler looks nothing like the one that we got from Xaml. We can pass events through almost directly, because the window message handling in the mouse input code actually came from conhost. It's awesome.

Neither TermControl nor conhost pass hover events through when the control isn't focused, so I wired up focus events to make sure we acted the same.

Just like Terminal and conhost, mouse events are suppressed when Shift is held.

Validation Steps Performed

Tested with MC, and tested by manually engaging SGR events in an Echo terminal.

image

**Original Pull Request:** https://github.com/microsoft/terminal/pull/5375 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This pull request ports the VT mouse code from TermControl to WpfTerminalControl. Our WPF control is a lot closer to Win32 than to Xaml, so our mouse event handler looks _nothing_ like the one that we got from Xaml. We can pass events through almost directly, because the window message handling in the mouse input code actually came from _conhost_. It's awesome. Neither TermControl nor conhost pass hover events through when the control isn't focused, so I wired up focus events to make sure we acted the same. Just like Terminal and conhost, mouse events are suppressed when <kbd>Shift</kbd> is held. ## Validation Steps Performed Tested with MC, and tested by manually engaging SGR events in an Echo terminal. ![image](https://user-images.githubusercontent.com/14316954/79417901-2f976a00-7f68-11ea-97e9-c053cbed3878.png)
claunia added the pull-request label 2026-01-31 09:15:10 +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#26290