[PR #13160] [MERGED] Use feature markers during terminal-by-default handoff #29418

Closed
opened 2026-01-31 09:34:48 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13160
Author: @lhecker
Created: 5/24/2022
Status: Merged
Merged: 6/7/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/wt-as-default


📝 Commits (4)

  • 89b4739 Use feature markers during terminal-by-default handoff
  • 33a69fe Improve layout of xaml dropdown
  • 23c1b96 Add comments
  • 8a80ac1 Address feedback

📊 Changes

25 files changed (+397 additions, -378 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+1 -0)
📝 src/cascadia/CascadiaPackage/Package-Dev.appxmanifest (+1 -0)
📝 src/cascadia/CascadiaPackage/Package-Pre.appxmanifest (+1 -0)
📝 src/cascadia/CascadiaPackage/Package.appxmanifest (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/Launch.xaml (+8 -3)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp (+20 -4)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp (+3 -1)
📝 src/cascadia/TerminalSettingsModel/DefaultTerminal.cpp (+22 -8)
📝 src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw (+4 -0)
📝 src/host/exe/CConsoleHandoff.h (+1 -1)
📝 src/host/exe/exemain.cpp (+1 -2)
📝 src/host/globals.h (+3 -3)
📝 src/host/proxy/IConsoleHandoff.idl (+6 -0)
📝 src/host/srvinit.cpp (+31 -42)
📝 src/inc/conint.h (+2 -2)
📝 src/internal/stubs.cpp (+4 -6)
📝 src/propsheet/TerminalPropsheetPage.cpp (+12 -11)
📝 src/propsheet/console.cpp (+3 -3)
📝 src/propsheet/console.h (+2 -1)
📝 src/propsheet/console.rc (+3 -2)

...and 5 more files

📄 Description

If we want to make Windows Terminal the default terminal under Windows,
we'll have to make conhost "handoff" incoming connections by default.
But this poses a problem: How can the seldomly updated conhost know
whether the routinely updated Windows Terminal version is actually willing
to accept such handoffs by default (it might be unwilling due to bugs, etc.)?

This commit solves the issue by introducing:

  • A marker interface (IDefaultTerminalMarker): If it exists,
    Windows Terminal indicates its willingness to accept the handoff.
  • Turning the all-0 GUID from being synonymous for conhost,
    to being synonymous for "Let Windows decide". Without this we wouldn't
    be able to differentiate between users who consciously chose conhost
    as their default terminal, vs. users who want the standard behavior.

Validation Steps Performed

Testing fallback behavior:

  • Install "Terminal" 1.13
  • Delete the 2 keys below HKCU\Console\%%Startup
  • Enable Feature_AttemptHandoff in features.xml
    Return true from DefaultApp::CheckShouldTerminalBeDefault
  • Replace conhost.exe and console.dll with sfpcopy after building
  • Launching cmd.exe launches as a conhost window
    (because "Terminal" 1.13 lacks the marker interface)
  • Open properties page in conhost.exe
    "Let Windows decide" is select by default
  • Changing the selection writes the new value

Testing the new behavior:

  • Delete the 2 keys below HKCU\Console\%%Startup
  • Enable Feature_AttemptHandoff in features.xml
    Return true from DefaultApp::CheckShouldTerminalBeDefault
  • Use CLSID_WindowsTerminalConsoleDev and CLSID_WindowsTerminalTerminalDev
    for the initialization of TerminalDelegationPair
  • Replace conhost.exe and console.dll with sfpcopy after building
  • Deploy the "Terminal Dev" package
  • Launching cmd.exe launches "Terminal Dev"
    (because "Terminal Dev" has the marker interface)
  • Open the settings tab
    "Let Windows decide" is select by default
  • Changing the selection and saving writes the new value

🔄 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/13160 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 5/24/2022 **Status:** ✅ Merged **Merged:** 6/7/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/wt-as-default` --- ### 📝 Commits (4) - [`89b4739`](https://github.com/microsoft/terminal/commit/89b4739b97433b3655c9c92fdaa20e9f5f765e3b) Use feature markers during terminal-by-default handoff - [`33a69fe`](https://github.com/microsoft/terminal/commit/33a69fe62be287e22b97b60d73f7eefa3f101004) Improve layout of xaml dropdown - [`23c1b96`](https://github.com/microsoft/terminal/commit/23c1b9601401c2911f861289658e31d6ef0bb260) Add comments - [`8a80ac1`](https://github.com/microsoft/terminal/commit/8a80ac1219265e803c1c8be90848d43ffec4907a) Address feedback ### 📊 Changes **25 files changed** (+397 additions, -378 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+1 -0) 📝 `src/cascadia/CascadiaPackage/Package-Dev.appxmanifest` (+1 -0) 📝 `src/cascadia/CascadiaPackage/Package-Pre.appxmanifest` (+1 -0) 📝 `src/cascadia/CascadiaPackage/Package.appxmanifest` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/Launch.xaml` (+8 -3) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp` (+20 -4) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/DefaultTerminal.cpp` (+22 -8) 📝 `src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw` (+4 -0) 📝 `src/host/exe/CConsoleHandoff.h` (+1 -1) 📝 `src/host/exe/exemain.cpp` (+1 -2) 📝 `src/host/globals.h` (+3 -3) 📝 `src/host/proxy/IConsoleHandoff.idl` (+6 -0) 📝 `src/host/srvinit.cpp` (+31 -42) 📝 `src/inc/conint.h` (+2 -2) 📝 `src/internal/stubs.cpp` (+4 -6) 📝 `src/propsheet/TerminalPropsheetPage.cpp` (+12 -11) 📝 `src/propsheet/console.cpp` (+3 -3) 📝 `src/propsheet/console.h` (+2 -1) 📝 `src/propsheet/console.rc` (+3 -2) _...and 5 more files_ </details> ### 📄 Description If we want to make Windows Terminal the default terminal under Windows, we'll have to make conhost "handoff" incoming connections by default. But this poses a problem: How can the seldomly updated conhost know whether the routinely updated Windows Terminal version is actually willing to accept such handoffs by default (it might be unwilling due to bugs, etc.)? This commit solves the issue by introducing: * A marker interface (`IDefaultTerminalMarker`): If it exists, Windows Terminal indicates its willingness to accept the handoff. * Turning the all-0 GUID from being synonymous for conhost, to being synonymous for "Let Windows decide". Without this we wouldn't be able to differentiate between users who consciously chose conhost as their default terminal, vs. users who want the standard behavior. ## Validation Steps Performed Testing fallback behavior: * Install "Terminal" 1.13 * Delete the 2 keys below `HKCU\Console\%%Startup` * Enable `Feature_AttemptHandoff` in `features.xml` Return `true` from `DefaultApp::CheckShouldTerminalBeDefault` * Replace `conhost.exe` and `console.dll` with `sfpcopy` after building * Launching `cmd.exe` launches as a conhost window ✅ (because "Terminal" 1.13 lacks the marker interface) * Open properties page in `conhost.exe` "Let Windows decide" is select by default ✅ * Changing the selection writes the new value ✅ Testing the new behavior: * Delete the 2 keys below `HKCU\Console\%%Startup` * Enable `Feature_AttemptHandoff` in `features.xml` Return `true` from `DefaultApp::CheckShouldTerminalBeDefault` * Use `CLSID_WindowsTerminalConsoleDev` and `CLSID_WindowsTerminalTerminalDev` for the initialization of `TerminalDelegationPair` * Replace `conhost.exe` and `console.dll` with `sfpcopy` after building * Deploy the "Terminal Dev" package * Launching `cmd.exe` launches "Terminal Dev" ✅ (because "Terminal Dev" has the marker interface) * Open the settings tab "Let Windows decide" is select by default ✅ * Changing the selection and saving writes the new value ✅ --- <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:34:48 +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#29418