Skip to content

Commit 4145f18

Browse files
authored
Fix closeOnExit: always (#16090)
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
1 parent aafb917 commit 4145f18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cascadia/TerminalApp/Pane.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ winrt::fire_and_forget Pane::_ControlConnectionStateChangedHandler(const winrt::
10401040
newConnectionState = coreState.ConnectionState();
10411041
}
10421042

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

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

0 commit comments

Comments
 (0)