diff --git a/src/cascadia/TerminalApp/Pane.cpp b/src/cascadia/TerminalApp/Pane.cpp index 19b09d5e9ce..82693d0dc03 100644 --- a/src/cascadia/TerminalApp/Pane.cpp +++ b/src/cascadia/TerminalApp/Pane.cpp @@ -1576,11 +1576,12 @@ void Pane::_CloseChild(const bool closeFirst, const bool isDetaching) // Find what borders need to persist after we close the child _borders = _GetCommonBorders(); - // take the control, profile and id of the pane that _wasn't_ closed. + // take the control, profile, id and isDefTermSession of the pane that _wasn't_ closed. _control = remainingChild->_control; _connectionState = remainingChild->_connectionState; _profile = remainingChild->_profile; _id = remainingChild->Id(); + _isDefTermSession = remainingChild->_isDefTermSession; // Add our new event handler before revoking the old one. _connectionStateChangedToken = _control.ConnectionStateChanged({ this, &Pane::_ControlConnectionStateChangedHandler }); @@ -2472,11 +2473,12 @@ std::pair, std::shared_ptr> Pane::_Split(SplitDirect } else { - // Move our control, guid into the first one. + // Move our control, guid, isDefTermSession into the first one. _firstChild = std::make_shared(_profile, _control); _firstChild->_connectionState = std::exchange(_connectionState, ConnectionState::NotConnected); _profile = nullptr; _control = { nullptr }; + _firstChild->_isDefTermSession = _isDefTermSession; } _splitState = actualSplitType; diff --git a/src/cascadia/TerminalApp/Pane.h b/src/cascadia/TerminalApp/Pane.h index 7094f3b3643..02336a94ccb 100644 --- a/src/cascadia/TerminalApp/Pane.h +++ b/src/cascadia/TerminalApp/Pane.h @@ -214,21 +214,24 @@ class Pane : public std::enable_shared_from_this winrt::Windows::UI::Xaml::Controls::Grid _root{}; winrt::Windows::UI::Xaml::Controls::Border _borderFirst{}; winrt::Windows::UI::Xaml::Controls::Border _borderSecond{}; - winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr }; - winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected }; static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_focusedBorderBrush; static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_unfocusedBorderBrush; +#pragma region Properties that need to be transferred between child / parent panes upon splitting / closing std::shared_ptr _firstChild{ nullptr }; std::shared_ptr _secondChild{ nullptr }; SplitState _splitState{ SplitState::None }; float _desiredSplitPosition; + winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr }; + winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected }; + winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr }; + bool _isDefTermSession{ false }; +#pragma endregion std::optional _id; std::weak_ptr _parentChildPath{}; bool _lastActive{ false }; - winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr }; winrt::event_token _connectionStateChangedToken{ 0 }; winrt::event_token _firstClosedToken{ 0 }; winrt::event_token _secondClosedToken{ 0 }; @@ -243,8 +246,6 @@ class Pane : public std::enable_shared_from_this bool _zoomed{ false }; - bool _isDefTermSession{ false }; - winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr }; winrt::Windows::Media::Playback::MediaPlayer::MediaEnded_revoker _mediaEndedRevoker;