[PR #10823] [MERGED] [DefApp] Move from Monarch multi instance servers to Peasant single instance servers #28244

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10823
Author: @leonMSFT
Created: 7/29/2021
Status: Merged
Merged: 8/5/2021
Merged by: @undefined

Base: mainHead: dev/lelian/defapp/bugfix


📝 Commits (10+)

  • e1d12b1 worky work
  • 73aa8ea worky work 2
  • 1643f22 worky work 3
  • 58742c9 Make sure we clean up after each call now that we're single use. Throw the inbound connection onto the UI thread so it doesn't have a hissy fit.
  • 815ab63 stop listening just as we start or we won't stop when crashing and that makes things mad.
  • 387fb34 comments
  • 81a3dc4 change OnNewTab to return HR so that OnNewConnection can tell when a tab failed to be created from defterm and can tell com that it shit the bed
  • 0ab6872 stash pfnHandoff before closing connection, OpenNewTab needs to be performed on a UI thread
  • 674dfb4 use til::latch, add mutex to CTerminalHandoff
  • 320a298 don't need optional
    , shared_mutex over regular ole mutex

📊 Changes

8 files changed (+74 additions, -50 deletions)

View changed files

📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+2 -2)
📝 src/cascadia/TerminalApp/AppLogic.cpp (+5 -0)
📝 src/cascadia/TerminalApp/TabManagement.cpp (+4 -2)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+37 -32)
📝 src/cascadia/TerminalApp/TerminalPage.h (+2 -2)
📝 src/cascadia/TerminalConnection/CTerminalHandoff.cpp (+21 -6)
📝 src/cascadia/TerminalConnection/CTerminalHandoff.h (+3 -3)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+0 -3)

📄 Description

  • Monarch no longer sets itself up as a CTerminalHandoff multi instance server by default
  • In fact, CTerminalHandoff will only ever be a single instance server
  • When COM needs a CTerminalHandoff, it launches wt.exe -embedding, which gets picked up by the Monarch and then gets handed off to itself/peasant depending on user settings.
  • Peasant now recognizes the -embedding commandline and will start a CTerminalHandoff single instance listener, and receives the connection into a new tab.

Closes #10358, #9475


🔄 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/10823 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 7/29/2021 **Status:** ✅ Merged **Merged:** 8/5/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lelian/defapp/bugfix` --- ### 📝 Commits (10+) - [`e1d12b1`](https://github.com/microsoft/terminal/commit/e1d12b161eeb66db262ead7ccd22c0e1d2e03cf1) worky work - [`73aa8ea`](https://github.com/microsoft/terminal/commit/73aa8ea51ff0e38ff90863a73347d50d19ccd3c5) worky work 2 - [`1643f22`](https://github.com/microsoft/terminal/commit/1643f221725594d5ab89938466878c3f32767ffa) worky work 3 - [`58742c9`](https://github.com/microsoft/terminal/commit/58742c9e291279b9b3f06716f743aea1eda438a5) Make sure we clean up after each call now that we're single use. Throw the inbound connection onto the UI thread so it doesn't have a hissy fit. - [`815ab63`](https://github.com/microsoft/terminal/commit/815ab63a423cfab9c3a6c34b9fbcb2be2f57069d) stop listening just as we start or we won't stop when crashing and that makes things mad. - [`387fb34`](https://github.com/microsoft/terminal/commit/387fb34c401bd24f4dbe761c9f691139a702e509) comments - [`81a3dc4`](https://github.com/microsoft/terminal/commit/81a3dc4141481781aa1528ac6af605c66c00a49d) change OnNewTab to return HR so that OnNewConnection can tell when a tab failed to be created from defterm and can tell com that it shit the bed - [`0ab6872`](https://github.com/microsoft/terminal/commit/0ab6872c560b9236e6740a5b8e14d61594d550a8) stash pfnHandoff before closing connection, OpenNewTab needs to be performed on a UI thread - [`674dfb4`](https://github.com/microsoft/terminal/commit/674dfb475ffd4da123f1bce2f094c53808f24b8b) use til::latch, add mutex to CTerminalHandoff - [`320a298`](https://github.com/microsoft/terminal/commit/320a298547e811529cac631573afd636da084bf7) don't need optional<HR>, shared_mutex over regular ole mutex ### 📊 Changes **8 files changed** (+74 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+2 -2) 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+5 -0) 📝 `src/cascadia/TerminalApp/TabManagement.cpp` (+4 -2) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+37 -32) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+2 -2) 📝 `src/cascadia/TerminalConnection/CTerminalHandoff.cpp` (+21 -6) 📝 `src/cascadia/TerminalConnection/CTerminalHandoff.h` (+3 -3) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+0 -3) </details> ### 📄 Description - Monarch no longer sets itself up as a `CTerminalHandoff` multi instance server by default - In fact, `CTerminalHandoff` will only ever be a single instance server - When COM needs a `CTerminalHandoff`, it launches `wt.exe -embedding`, which gets picked up by the Monarch and then gets handed off to itself/peasant depending on user settings. - Peasant now recognizes the `-embedding` commandline and will start a `CTerminalHandoff` single instance listener, and receives the connection into a new tab. Closes #10358, #9475 --- <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:27:16 +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#28244