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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10263
Author: @DHowett
Created: 5/28/2021
Status: Merged
Merged: 5/28/2021
Merged by: @DHowett

Base: mainHead: dev/duhowett/well_lets_try_state_better


📝 Commits (1)

  • f644517 Ignore closeOnExit when a connection moves to Failed w/o being Connected

📊 Changes

3 files changed (+14 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalApp/Pane.cpp (+11 -0)
📝 src/cascadia/TerminalApp/Pane.h (+1 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+2 -0)

📄 Description

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.


🔄 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/10263 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 5/28/2021 **Status:** ✅ Merged **Merged:** 5/28/2021 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/duhowett/well_lets_try_state_better` --- ### 📝 Commits (1) - [`f644517`](https://github.com/microsoft/terminal/commit/f644517d8601e42ac23a975c7ba58612763f11fe) Ignore closeOnExit when a connection moves to Failed w/o being Connected ### 📊 Changes **3 files changed** (+14 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/Pane.cpp` (+11 -0) 📝 `src/cascadia/TerminalApp/Pane.h` (+1 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+2 -0) </details> ### 📄 Description 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. --- <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:25:27 +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#27968