[PR #10263] Ignore closeOnExit when a conn. moves from Connecting to Failed #27973

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

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

State: closed
Merged: Yes


ConptyConnection has two different failure modes:

  1. We failed to initialize the pseudoconsole or create the process
  2. The process exited with an error code.

Until this commit, they were treated the same way: closeOnExit=always
would force the pane/tab to be destroyed. This was very bad in case 1,
where we would display a (possibly useful) error message and then
immediately close the window.

This was made even worse by the change in #10045. We removed
startingDirectory validation and promoted it to an error message (so
that we could eventually let the connection handle startingDirectory in
its own way.) This of course revealed that a number of users had set
invalid starting directories… and those users included some who set
closeOnExit to always. Boom: instant "terminal opens and crashes"¹

¹ It only looks like a crash; it's actually technically functioning
properly.

Closes #10225.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10263 **State:** closed **Merged:** Yes --- ConptyConnection has two different failure modes: 1. We failed to initialize the pseudoconsole or create the process 2. The process exited with an error code. Until this commit, they were treated the same way: closeOnExit=always would force the pane/tab to be destroyed. This was very bad in case 1, where we would display a (possibly useful) error message and then immediately close the window. This was made even worse by the change in #10045. We removed startingDirectory validation and promoted it to an error message (so that we could eventually let the connection handle startingDirectory in its own way.) This of course revealed that a number of users had set invalid starting directories… and those users included some who set closeOnExit to always. Boom: instant "terminal opens and crashes"¹ ¹ It only looks like a crash; it's actually _technically_ functioning properly. Closes #10225.
claunia added the pull-request label 2026-01-31 09:25:28 +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#27973