[PR #3461] [MERGED] Replace ConhostConnection with ConptyConnection #25370

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3461
Author: @DHowett-MSFT
Created: 11/6/2019
Status: Merged
Merged: 11/6/2019
Merged by: @DHowett-MSFT

Base: masterHead: dev/duhowett/die_conhostconnection_ist


📝 Commits (5)

  • 01a146f Replace ConhostConnection with ConptyConnection
  • 90a4e7c PR feedback
  • e887dc9 PR feedback II
  • add9ebd turns out this was already IN libraryincludes
  • 3a9b4fe fix a stray parameter name

📊 Changes

17 files changed (+523 additions, -889 deletions)

View changed files

📝 build/scripts/Test-WindowsTerminalPackage.ps1 (+4 -0)
📝 src/cascadia/CascadiaPackage/CascadiaPackage.wapproj (+1 -6)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+6 -6)
src/cascadia/TerminalConnection/ConhostConnection.cpp (+0 -238)
src/cascadia/TerminalConnection/ConhostConnection.h (+0 -58)
src/cascadia/TerminalConnection/ConhostConnection.idl (+0 -15)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+257 -180)
📝 src/cascadia/TerminalConnection/ConptyConnection.h (+30 -17)
📝 src/cascadia/TerminalConnection/ConptyConnection.idl (+2 -1)
📝 src/cascadia/TerminalConnection/TerminalConnection.vcxproj (+15 -6)
📝 src/cascadia/TerminalConnection/TerminalConnection.vcxproj.filters (+2 -3)
📝 src/common.build.pre.props (+4 -0)
src/inc/conpty-universal.h (+0 -358)
src/types/Environment.cpp (+132 -0)
src/types/inc/Environment.hpp (+31 -0)
📝 src/types/lib/types.vcxproj (+2 -0)
📝 src/winconpty/winconpty.vcxproj (+37 -1)

📄 Description

This commit deletes ConhostConnection and replaces it with
ConptyConnection. The ConptyConnection uses CreatePseudoConsole and
depends on winconpty to override the one from kernel32.

  • winconpty must be packageable, so I've added GetPackagingOutputs.
    • To validate this, I added conpty.dll to the MSIX regression script.
  • I moved the code from conpty-universal that deals with environment
    strings into the types library.

This puts us in a way better place to implement #2563, as we can now
separately detect a failure to launch a pseudoconsole, a failure to
CreateProcess, and a failure of the launched process.

Fixes #1131.

References

Relevant to #2563.

PR Checklist

  • Closes Missing Files (#1131)
  • CLA
  • Tests added/passed
  • Requires documentation to be updated
  • It is a core contributor.

Validation Steps Performed

Launched WT a bunch, with shells and pseudoterminal hosts that didn't exist, and killed various processes all over the tree.


🔄 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/3461 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 11/6/2019 **Status:** ✅ Merged **Merged:** 11/6/2019 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/duhowett/die_conhostconnection_ist` --- ### 📝 Commits (5) - [`01a146f`](https://github.com/microsoft/terminal/commit/01a146f4d7b40e84b7cd489c54592240faf8a4a3) Replace ConhostConnection with ConptyConnection - [`90a4e7c`](https://github.com/microsoft/terminal/commit/90a4e7c4ad63af826de2c0ec206e5b82b2247d02) PR feedback - [`e887dc9`](https://github.com/microsoft/terminal/commit/e887dc9c74e0d6de98a7a358dff1ef6f4d26a5cc) PR feedback II - [`add9ebd`](https://github.com/microsoft/terminal/commit/add9ebd914a48d9a8c71013d280c13acb79cfc67) turns out this was already IN libraryincludes - [`3a9b4fe`](https://github.com/microsoft/terminal/commit/3a9b4fe268870bf7474bc757ef180ad46f0cd806) fix a stray parameter name ### 📊 Changes **17 files changed** (+523 additions, -889 deletions) <details> <summary>View changed files</summary> 📝 `build/scripts/Test-WindowsTerminalPackage.ps1` (+4 -0) 📝 `src/cascadia/CascadiaPackage/CascadiaPackage.wapproj` (+1 -6) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+6 -6) ➖ `src/cascadia/TerminalConnection/ConhostConnection.cpp` (+0 -238) ➖ `src/cascadia/TerminalConnection/ConhostConnection.h` (+0 -58) ➖ `src/cascadia/TerminalConnection/ConhostConnection.idl` (+0 -15) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+257 -180) 📝 `src/cascadia/TerminalConnection/ConptyConnection.h` (+30 -17) 📝 `src/cascadia/TerminalConnection/ConptyConnection.idl` (+2 -1) 📝 `src/cascadia/TerminalConnection/TerminalConnection.vcxproj` (+15 -6) 📝 `src/cascadia/TerminalConnection/TerminalConnection.vcxproj.filters` (+2 -3) 📝 `src/common.build.pre.props` (+4 -0) ➖ `src/inc/conpty-universal.h` (+0 -358) ➕ `src/types/Environment.cpp` (+132 -0) ➕ `src/types/inc/Environment.hpp` (+31 -0) 📝 `src/types/lib/types.vcxproj` (+2 -0) 📝 `src/winconpty/winconpty.vcxproj` (+37 -1) </details> ### 📄 Description This commit deletes ConhostConnection and replaces it with ConptyConnection. The ConptyConnection uses CreatePseudoConsole and depends on winconpty to override the one from kernel32. * winconpty must be packageable, so I've added GetPackagingOutputs. * To validate this, I added conpty.dll to the MSIX regression script. * I moved the code from conpty-universal that deals with environment strings into the types library. This puts us in a way better place to implement #2563, as we can now separately detect a failure to launch a pseudoconsole, a failure to CreateProcess, and a failure of the launched process. Fixes #1131. ## References Relevant to #2563. ## PR Checklist * [x] Closes #1131 * [x] CLA * [x] Tests added/passed * [ ] Requires documentation to be updated * [x] It is a core contributor. ## Validation Steps Performed Launched WT a bunch, with shells and pseudoterminal hosts that didn't exist, and killed various processes all over the tree. --- <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:09:06 +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#25370