[PR #1340] Fix the total teardown order for ConhostConnection #24593

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

Original Pull Request: https://github.com/microsoft/terminal/pull/1340

State: closed
Merged: Yes


The signal pipe must be terminated first. It is this very termination
that signals to the connected console host that it should begin exiting
in an orderly manner.

We're introducing an indefinite wait (yes, I know: it's not great) for
conhost to exit. This matches ClosePseudoConsole in
kernelbase/winconpty.

If it does not exit in an orderly manner, powershell (and perhaps other
.NET CLI applications) may crash immediately after conhost exits.

Fixes #1338.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/1340 **State:** closed **Merged:** Yes --- The signal pipe must be terminated first. It is this very termination that signals to the connected console host that it should begin exiting in an orderly manner. We're introducing an indefinite wait (yes, I know: it's not great) for conhost to exit. **This matches ClosePseudoConsole in kernelbase/winconpty.** If it does not exit in an orderly manner, powershell (and perhaps other .NET CLI applications) may crash immediately after conhost exits. Fixes #1338.
claunia added the pull-request label 2026-01-31 09:04: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#24593