[PR #4859] [MERGED] Synthesize VT mouse events and add mouse support to Terminal #25995

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4859
Author: @carlos-zamora
Created: 3/9/2020
Status: Merged
Merged: 3/13/2020
Merged by: @DHowett-MSFT

Base: masterHead: dev/cazamor/vtmm/wt-synthesis


📝 Commits (9)

  • 30710b1 Synthesize VT Mouse Events
  • 796446a Revert "Update the dragbar when the titlebar content size changes (#4845)"
  • 7c532e5 clean up TrySendMouseEvent and other PR comments
  • d04effe fix some errors and PR comments
  • 31153ce fix capture issue
  • fea90a7 Revert "Revert "Update the dragbar when the titlebar content size changes (#4845)""
  • b483c66 fix a few miscellaneous things. Still no fix for the drag bug.
  • 5c720be Properly mix selection and VTMM story
  • a861356 fix SA

📊 Changes

11 files changed (+421 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+102 -0)
📝 src/cascadia/TerminalControl/TermControl.h (+2 -0)
📝 src/cascadia/TerminalCore/ITerminalApi.hpp (+11 -0)
📝 src/cascadia/TerminalCore/ITerminalInput.hpp (+1 -0)
📝 src/cascadia/TerminalCore/Terminal.cpp (+37 -0)
📝 src/cascadia/TerminalCore/Terminal.hpp (+13 -0)
📝 src/cascadia/TerminalCore/TerminalApi.cpp (+54 -0)
📝 src/cascadia/TerminalCore/TerminalDispatch.cpp (+172 -0)
📝 src/cascadia/TerminalCore/TerminalDispatch.hpp (+16 -0)
📝 src/terminal/input/mouseInput.cpp (+11 -0)
📝 src/terminal/input/terminalInput.hpp (+2 -0)

📄 Description

Summary of the Pull Request

Make TerminalControl synthesize mouse events and Terminal send them to
the TerminalInput's MouseInput module.

The implementation here takes significant inspiration from how we handle
KeyEvents.

References

Closes #545 - VT Mouse Mode (Terminal)
References #376 - VT Mouse Mode (ConPty)

TerminalControl

  • _TrySendMouseEvent attempts to send a mouse event via TermInput.
    Similar to _TrySendKeyEvent
  • Use the above function to try and send the mouse event before
    deciding to modify the selection

TerminalApi

  • Hookup (re)setting the various modes to handle VT Input
  • Terminal is always in VT Input mode (important for #4856)

TerminalDispatch

  • Hookup (re)setting the various modes to handle VT Input

TerminalInput

  • Convert the mouse input position from viewport position to buffer
    position
  • Then send it over to the MouseInput in TerminalInput to actually do it
    (#4848)

Validation Steps Performed

Tests should still pass.


🔄 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/4859 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 3/9/2020 **Status:** ✅ Merged **Merged:** 3/13/2020 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/cazamor/vtmm/wt-synthesis` --- ### 📝 Commits (9) - [`30710b1`](https://github.com/microsoft/terminal/commit/30710b1255587fa6b53d3732e63145fe6b7bcc5d) Synthesize VT Mouse Events - [`796446a`](https://github.com/microsoft/terminal/commit/796446a95fea246a4d9a1c0cf3e4907d8a0d8367) Revert "Update the dragbar when the titlebar content size changes (#4845)" - [`7c532e5`](https://github.com/microsoft/terminal/commit/7c532e51aec8e7908aa01a80a7a1c57044166b85) clean up TrySendMouseEvent and other PR comments - [`d04effe`](https://github.com/microsoft/terminal/commit/d04effed436adb02c5ad8f9ba7bd5d5ab19dcce4) fix some errors and PR comments - [`31153ce`](https://github.com/microsoft/terminal/commit/31153ce310e4bb1f6089cceb045d866c5020a01f) fix capture issue - [`fea90a7`](https://github.com/microsoft/terminal/commit/fea90a7d3e69262829224163ed66d7706164d5c8) Revert "Revert "Update the dragbar when the titlebar content size changes (#4845)"" - [`b483c66`](https://github.com/microsoft/terminal/commit/b483c662915590764031e2cbc104278b88486d5c) fix a few miscellaneous things. Still no fix for the drag bug. - [`5c720be`](https://github.com/microsoft/terminal/commit/5c720be77a492b135cec145916cb0d7d5641fcdc) Properly mix selection and VTMM story - [`a861356`](https://github.com/microsoft/terminal/commit/a8613567d52a8e3dddc028866d3476198c30fbb8) fix SA ### 📊 Changes **11 files changed** (+421 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+102 -0) 📝 `src/cascadia/TerminalControl/TermControl.h` (+2 -0) 📝 `src/cascadia/TerminalCore/ITerminalApi.hpp` (+11 -0) 📝 `src/cascadia/TerminalCore/ITerminalInput.hpp` (+1 -0) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+37 -0) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+13 -0) 📝 `src/cascadia/TerminalCore/TerminalApi.cpp` (+54 -0) 📝 `src/cascadia/TerminalCore/TerminalDispatch.cpp` (+172 -0) 📝 `src/cascadia/TerminalCore/TerminalDispatch.hpp` (+16 -0) 📝 `src/terminal/input/mouseInput.cpp` (+11 -0) 📝 `src/terminal/input/terminalInput.hpp` (+2 -0) </details> ### 📄 Description ## Summary of the Pull Request Make TerminalControl synthesize mouse events and Terminal send them to the TerminalInput's MouseInput module. The implementation here takes significant inspiration from how we handle KeyEvents. ## References Closes #545 - VT Mouse Mode (Terminal) References #376 - VT Mouse Mode (ConPty) ### TerminalControl - `_TrySendMouseEvent` attempts to send a mouse event via TermInput. Similar to `_TrySendKeyEvent` - Use the above function to try and send the mouse event _before_ deciding to modify the selection ### TerminalApi - Hookup (re)setting the various modes to handle VT Input - Terminal is _always_ in VT Input mode (important for #4856) ### TerminalDispatch - Hookup (re)setting the various modes to handle VT Input ### TerminalInput - Convert the mouse input position from viewport position to buffer position - Then send it over to the MouseInput in TerminalInput to actually do it (#4848) ## Validation Steps Performed Tests should still pass. --- <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:13:11 +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#25995