Skip to content

Commit

Permalink
Fix closeOnExit: always (#16090)
Browse files Browse the repository at this point in the history
Well, Pane doesn't _only_ care if the connection isn't entering a
terminal state. It does need to update its own state first.

Regressed in #15335

Closes #16068

(cherry picked from commit 4145f18)
Service-Card-Id: 90731934
Service-Version: 1.19
  • Loading branch information
zadjii-msft authored and DHowett committed Oct 3, 2023
1 parent f6e1126 commit 6ecdae7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/Pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ winrt::fire_and_forget Pane::_ControlConnectionStateChangedHandler(const winrt::
newConnectionState = coreState.ConnectionState();
}

const auto previousConnectionState = std::exchange(_connectionState, newConnectionState);
if (newConnectionState < ConnectionState::Closed)
{
// Pane doesn't care if the connection isn't entering a terminal state.
Expand All @@ -1066,7 +1067,6 @@ winrt::fire_and_forget Pane::_ControlConnectionStateChangedHandler(const winrt::
co_return;
}

const auto previousConnectionState = std::exchange(_connectionState, newConnectionState);
if (previousConnectionState < ConnectionState::Connected && newConnectionState >= ConnectionState::Failed)
{
// A failure to complete the connection (before it has _connected_) is not covered by "closeOnExit".
Expand Down

0 comments on commit 6ecdae7

Please sign in to comment.