[PR #12980] [MERGED] Build a NuGet Package for ConPTY #29320

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12980
Author: @DHowett
Created: 4/26/2022
Status: Merged
Merged: 4/27/2022
Merged by: @undefined

Base: mainHead: dev/duhowett/conpty-nupkg


📝 Commits (10+)

  • 1f01e1a Build a nuget package for conpty, 1
  • 8cebaa7 Try to isolate conpty build, 2
  • 3d6237d Make it its own var, 3
  • 33f697d conpty-ONLY builds probably need openconsole too, 4
  • 7213799 5
  • 9d81b81 Do the right stuff for .NET, 6
  • 8ebb32f Expose ..AsUser, make sure static consumers work still, 7
  • e1aa945 winconpty: look for an arch-specific version of OpenConsole, 8
  • 1da5ae2 and don't be dumb, 9
  • e4ba2f1 export ReparentPseudoConsole, 10

📊 Changes

14 files changed (+354 additions, -12 deletions)

View changed files

📝 .github/actions/spelling/excludes.txt (+1 -0)
📝 .github/actions/spelling/expect/expect.txt (+2 -0)
build/config/ESRPSigning_ConPTY.json (+51 -0)
📝 build/pipelines/release.yml (+130 -1)
📝 src/cascadia/TerminalConnection/TerminalConnection.vcxproj (+2 -0)
📝 src/host/ft_host/Host.FeatureTests.vcxproj (+2 -0)
📝 src/inc/conpty-static.h (+17 -11)
📝 src/winconpty/dll/winconpty.def (+13 -0)
src/winconpty/package/managed/Microsoft.Windows.Console.ConPTY.props (+24 -0)
src/winconpty/package/managed/Microsoft.Windows.Console.ConPTY.targets (+20 -0)
src/winconpty/package/native/Microsoft.Windows.Console.ConPTY.props (+4 -0)
src/winconpty/package/native/Microsoft.Windows.Console.ConPTY.targets (+23 -0)
src/winconpty/package/winconpty.nuspec (+34 -0)
📝 src/winconpty/winconpty.cpp (+31 -0)

📄 Description

This pull request introduces a packaging phase that emits
Microsoft.Windows.Console.ConPTY, a nuget package that contains the
pseudoconsole API as well as the requisite copies of conhost.

  • winconpty learned to load a version of OpenConsole.exe specific to the
    processor architecture on its hosting machine
  • the package, as well as its contents, is signed properly and is nearly
    ready for distribution via nuget.org
  • the API in conpty-static.h has been adjusted to expose
    CreatePseudoConsoleAsUser and stamp out the correct DLL import/export
    annotations.
  • getting .NET to play right was somewhat challenging, but I tested this
    against .NET 6.0 and it seemed to work properly; it shipped conpty.dll
    in the right places, and it shipped OpenConsole.exe next to the
    published application.

In the future, we could provide an interop assembly for C# consumers;
that is, unfortunately, out of scope today.

Closes #3577
Closes #3568
Obsoletes #1130


🔄 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/12980 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 4/26/2022 **Status:** ✅ Merged **Merged:** 4/27/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/duhowett/conpty-nupkg` --- ### 📝 Commits (10+) - [`1f01e1a`](https://github.com/microsoft/terminal/commit/1f01e1a0d8d8c48b9476e1257fea0c1c4f5879ea) Build a nuget package for conpty, 1 - [`8cebaa7`](https://github.com/microsoft/terminal/commit/8cebaa743e9e90acef95d05c10dedb1429e274c7) Try to isolate conpty build, 2 - [`3d6237d`](https://github.com/microsoft/terminal/commit/3d6237d32b61f0d8ea5b4fe8ef50a10ab707b4e2) Make it its own var, 3 - [`33f697d`](https://github.com/microsoft/terminal/commit/33f697d80b5608656454949ab96bc792f830e5bb) conpty-ONLY builds probably need openconsole too, 4 - [`7213799`](https://github.com/microsoft/terminal/commit/7213799a34a3ed9b60d4fe8342039dc9e9073695) 5 - [`9d81b81`](https://github.com/microsoft/terminal/commit/9d81b81fe81048ab30c386dd7f497bfe5bcf5b9d) Do the right stuff for .NET, 6 - [`8ebb32f`](https://github.com/microsoft/terminal/commit/8ebb32f820deaf38da9b4ffb679d93f4b37001c4) Expose ..AsUser, make sure static consumers work still, 7 - [`e1aa945`](https://github.com/microsoft/terminal/commit/e1aa9453a9da049cd97f15eb91d86fe36f998d65) winconpty: look for an arch-specific version of OpenConsole, 8 - [`1da5ae2`](https://github.com/microsoft/terminal/commit/1da5ae2e5b72f07cab68b77bfcacf75d193605ad) and don't be dumb, 9 - [`e4ba2f1`](https://github.com/microsoft/terminal/commit/e4ba2f1132e7458ae23fcf504706bf760529aa8d) export ReparentPseudoConsole, 10 ### 📊 Changes **14 files changed** (+354 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/excludes.txt` (+1 -0) 📝 `.github/actions/spelling/expect/expect.txt` (+2 -0) ➕ `build/config/ESRPSigning_ConPTY.json` (+51 -0) 📝 `build/pipelines/release.yml` (+130 -1) 📝 `src/cascadia/TerminalConnection/TerminalConnection.vcxproj` (+2 -0) 📝 `src/host/ft_host/Host.FeatureTests.vcxproj` (+2 -0) 📝 `src/inc/conpty-static.h` (+17 -11) 📝 `src/winconpty/dll/winconpty.def` (+13 -0) ➕ `src/winconpty/package/managed/Microsoft.Windows.Console.ConPTY.props` (+24 -0) ➕ `src/winconpty/package/managed/Microsoft.Windows.Console.ConPTY.targets` (+20 -0) ➕ `src/winconpty/package/native/Microsoft.Windows.Console.ConPTY.props` (+4 -0) ➕ `src/winconpty/package/native/Microsoft.Windows.Console.ConPTY.targets` (+23 -0) ➕ `src/winconpty/package/winconpty.nuspec` (+34 -0) 📝 `src/winconpty/winconpty.cpp` (+31 -0) </details> ### 📄 Description This pull request introduces a packaging phase that emits Microsoft.Windows.Console.ConPTY, a nuget package that contains the pseudoconsole API as well as the requisite copies of conhost. * winconpty learned to load a version of OpenConsole.exe specific to the processor architecture on its hosting machine * the package, as well as its contents, is signed properly and is nearly ready for distribution via nuget.org * the API in conpty-static.h has been adjusted to expose CreatePseudoConsoleAsUser and stamp out the correct DLL import/export annotations. * getting .NET to play right was somewhat challenging, but I tested this against .NET 6.0 and it seemed to work properly; it shipped conpty.dll in the right places, and it shipped OpenConsole.exe next to the published application. In the future, we could provide an interop assembly for C# consumers; that is, unfortunately, out of scope today. Closes #3577 Closes #3568 Obsoletes #1130 --- <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:14 +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#29320