[PR #3623] Implement ConnectionState and closeOnExit=graceful/always/never #25456

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

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

State: closed
Merged: Yes


Summary of the Pull Request

This pull request implements the new ITerminalConnection::ConnectionState interface (enum, event) and connects it through TerminalControl to Pane, Tab and App as specified in #2039. It does so to implement closeOnExit = graceful in addition to the other two normal CoE types.

It also:

  • ... exposes the singleton CascadiaSettings through a function that looks it up by using the current Xaml application's AppLogic.
    • In so doing, we've broken up the weird runaround where App tells TerminalSettings to CloseOnExit and then later another part of App asks TerminalControl to tell it what TerminalSettings said App told it earlier. :crazy_eyes:
  • ... wires up a bunch of connection state points to AzureConnection. This required moving the Azure connection's state machine to use another enum name (oops).
  • ... ships a helper class for managing connection state transitions.
  • ... contains a bunch of template magic.
  • ... contains a TODO (whoops, sorry, if you point it out you'll be removed from the selfhost program)
  • ... introduces WINRT_CALLBACK, a oneshot callback like TYPED_EVENT.
  • ... replaces a bunch of disparate _connecting and _closing members with just one uberstate.

References

Specification is in PR #2039.

PR Checklist

**Original Pull Request:** https://github.com/microsoft/terminal/pull/3623 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This pull request implements the new `ITerminalConnection::ConnectionState` interface (enum, event) and connects it through TerminalControl to Pane, Tab and App as specified in #2039. It does so to implement `closeOnExit` = `graceful` in addition to the other two normal CoE types. It also: * ... exposes the singleton `CascadiaSettings` through a function that looks it up by using the current Xaml application's `AppLogic`. * In so doing, we've broken up the weird runaround where App tells TerminalSettings to CloseOnExit and then later another part of App _asks TerminalControl_ to tell it what TerminalSettings said App told it earlier. `:crazy_eyes:` * ... wires up a bunch of connection state points to `AzureConnection`. This required moving the Azure connection's state machine to use another enum name (oops). * ... ships a helper class for managing connection state transitions. * ... contains a bunch of template magic. * ... contains a TODO (whoops, sorry, if you point it out you'll be removed from the selfhost program) * ... introduces `WINRT_CALLBACK`, a oneshot callback like `TYPED_EVENT`. * ... replaces a bunch of disparate `_connecting` and `_closing` members with just one uberstate. ## References Specification is in PR #2039. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #2563, Closes #982 * [x] CLA * [ ] Tests added/passed * [x] Requires documentation to be updated * [x] I've discussed this with core contributors already.
claunia added the pull-request label 2026-01-31 09:09:38 +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#25456