Skip to content

Commit

Permalink
Fix closeOnExit: always
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
  • Loading branch information
zadjii-msft committed Oct 2, 2023
1 parent 1669036 commit 56625cc
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 56625cc

Please sign in to comment.