[PR #14548] [CLOSED] Refactor how connection restarting is handled #30145

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14548
Author: @zadjii-msft
Created: 12/13/2022
Status: Closed

Base: mainHead: dev/migrie/b/cxn-restarting-attempt-1-backport


📝 Commits (10+)

  • 21cf69d Add support to close a failed pain with ctrl+D
  • 5606291 Implement ctrl+D as an event that Pane watches
  • 6de50b0 Fix a couple of typos from the last cleanup
  • d902eb8 Fix formatting issues
  • 092957f Add support for restarting terminal with Enter
  • 27096e6 Add comment to line setting PSEUDOCONSOLE_INHERIT_CURSOR
  • ec7dfc5 Keep track of rows/cols in connection even when disconnected
  • 82b6876 Fix analysis error
  • 62888a5 Add comment to help with localization.
  • 899f009 Update message to use Ctrl+D instead of ^D

📊 Changes

15 files changed (+227 additions, -103 deletions)

View changed files

📝 .github/actions/spelling/allow/apis.txt (+1 -0)
📝 .github/actions/spelling/allow/microsoft.txt (+1 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+89 -51)
📝 src/cascadia/TerminalApp/TerminalPage.h (+5 -2)
📝 src/cascadia/TerminalConnection/ConnectionInformation.cpp (+23 -20)
📝 src/cascadia/TerminalConnection/ConnectionStateHolder.h (+0 -8)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+24 -8)
📝 src/cascadia/TerminalConnection/ConptyConnection.h (+3 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.idl (+2 -0)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+59 -13)
📝 src/cascadia/TerminalControl/ControlCore.h (+4 -1)
📝 src/cascadia/TerminalControl/ControlCore.idl (+2 -0)
📝 src/cascadia/TerminalControl/TermControl.cpp (+9 -0)
📝 src/cascadia/TerminalControl/TermControl.h (+3 -0)
📝 src/cascadia/TerminalControl/TermControl.idl (+2 -0)

📄 Description

Admittedly, this is a lot of annoying plumbing.

We didn't love that a connection could transition back in the state diagram, from Closed -> Start. That felt wrong. To remedy this, we're going to allow the ControlCore to re-create connections, all on its own. This builds on a lot of work that was originally done for Process Model v2 (#5000), and was originally slated to be merged in #12938.

Basically, all the properties for a Connection are stashed already in a ConnectionState object. We're gonna take that, and stash the info in the ControlCore. When the control wants to restart the connection, it just uses that to rebuild a new one.

Cleanup from #14060

Closes #14327


🔄 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/14548 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 12/13/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dev/migrie/b/cxn-restarting-attempt-1-backport` --- ### 📝 Commits (10+) - [`21cf69d`](https://github.com/microsoft/terminal/commit/21cf69d7413f64fa9625e2665654e569c602574a) Add support to close a failed pain with ctrl+D - [`5606291`](https://github.com/microsoft/terminal/commit/560629114c2ac8e8dd40ba3689f5d7137fab767f) Implement ctrl+D as an event that Pane watches - [`6de50b0`](https://github.com/microsoft/terminal/commit/6de50b036abe99892ca0401c740b1c4b4ab4735e) Fix a couple of typos from the last cleanup - [`d902eb8`](https://github.com/microsoft/terminal/commit/d902eb8477d51153474d80984853039b6157cac8) Fix formatting issues - [`092957f`](https://github.com/microsoft/terminal/commit/092957f937e85b589324a657d100ec40cf76058a) Add support for restarting terminal with Enter - [`27096e6`](https://github.com/microsoft/terminal/commit/27096e619f0e476aacca8470e5953e3a46910e9c) Add comment to line setting PSEUDOCONSOLE_INHERIT_CURSOR - [`ec7dfc5`](https://github.com/microsoft/terminal/commit/ec7dfc5525a753d9ec75be4343683893172ab19d) Keep track of rows/cols in connection even when disconnected - [`82b6876`](https://github.com/microsoft/terminal/commit/82b687682f83ff01af922dbd13777a2045588906) Fix analysis error - [`62888a5`](https://github.com/microsoft/terminal/commit/62888a5a0f2ccda00b53e52e96537fd67213e4ab) Add comment to help with localization. - [`899f009`](https://github.com/microsoft/terminal/commit/899f00910e139e61774e826988db08580059a7d6) Update message to use Ctrl+D instead of ^D ### 📊 Changes **15 files changed** (+227 additions, -103 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/apis.txt` (+1 -0) 📝 `.github/actions/spelling/allow/microsoft.txt` (+1 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+89 -51) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+5 -2) 📝 `src/cascadia/TerminalConnection/ConnectionInformation.cpp` (+23 -20) 📝 `src/cascadia/TerminalConnection/ConnectionStateHolder.h` (+0 -8) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+24 -8) 📝 `src/cascadia/TerminalConnection/ConptyConnection.h` (+3 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.idl` (+2 -0) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+59 -13) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+4 -1) 📝 `src/cascadia/TerminalControl/ControlCore.idl` (+2 -0) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+9 -0) 📝 `src/cascadia/TerminalControl/TermControl.h` (+3 -0) 📝 `src/cascadia/TerminalControl/TermControl.idl` (+2 -0) </details> ### 📄 Description Admittedly, this is a lot of annoying plumbing. We didn't love that a connection could transition back in the state diagram, from Closed -> Start. That felt wrong. To remedy this, we're going to allow the ControlCore to re-create connections, all on its own. This builds on a lot of work that was originally done for Process Model v2 (#5000), and was originally slated to be merged in #12938. Basically, all the properties for a Connection are stashed already in a `ConnectionState` object. We're gonna take that, and stash the info in the ControlCore. When the control wants to restart the connection, it just uses that to rebuild a new one. Cleanup from #14060 Closes #14327 --- <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:38:54 +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#30145