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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5375
Author: @DHowett-MSFT
Created: 4/16/2020
Status: ✅ Merged
Merged: 4/17/2020
Merged by: @undefined

Base: master ← Head: dev/duhowett/wpf/vt_mouse


📝 Commits (4)

  • 70b53f4 wpf: wire up focus events
  • 25c9c7e wpf: wire up mouse events
  • 3c78886 SA, Format
  • 7dbbd91 Merge remote-tracking branch 'origin/master' into dev/duhowett/wpf/vt_mouse

📊 Changes

4 files changed (+75 additions, -0 deletions)

View changed files

📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+58 -0)
📝 src/cascadia/PublicTerminalCore/HwndTerminal.hpp (+9 -0)
📝 src/cascadia/WpfTerminalControl/NativeMethods.cs (+6 -0)
📝 src/cascadia/WpfTerminalControl/TerminalContainer.cs (+2 -0)

📄 Description

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


🔄 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/5375 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 4/16/2020 **Status:** ✅ Merged **Merged:** 4/17/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/duhowett/wpf/vt_mouse` --- ### 📝 Commits (4) - [`70b53f4`](https://github.com/microsoft/terminal/commit/70b53f4fd4bbc91e8c3f4af7216924209a88bd95) wpf: wire up focus events - [`25c9c7e`](https://github.com/microsoft/terminal/commit/25c9c7e5fc881fd7741e677724bf031ab8d2fb0c) wpf: wire up mouse events - [`3c78886`](https://github.com/microsoft/terminal/commit/3c78886869478affba7b585d438ea93dccbf2ecc) SA, Format - [`7dbbd91`](https://github.com/microsoft/terminal/commit/7dbbd9125fc278f8f06be99094ceebf878a266db) Merge remote-tracking branch 'origin/master' into dev/duhowett/wpf/vt_mouse ### 📊 Changes **4 files changed** (+75 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+58 -0) 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.hpp` (+9 -0) 📝 `src/cascadia/WpfTerminalControl/NativeMethods.cs` (+6 -0) 📝 `src/cascadia/WpfTerminalControl/TerminalContainer.cs` (+2 -0) </details> ### 📄 Description ## 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) --- <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:15:09 +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#26285