From 7b3ca83329ba3f37de4635db1fd347858ea2ce3b Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Wed, 13 Apr 2022 06:08:07 -0500 Subject: [PATCH] this reconnects the new window to the existing content process --- src/cascadia/TerminalControl/TermControl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 859365d502..190db59cd1 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -756,11 +756,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation const auto coreInitialized = _core.Initialize(panelWidth, panelHeight, panelScaleX); - if (!coreInitialized) + // ControlCore::Initialize will return false if it was already + // initialized. In that case, don't init the rest of the interactivity, + // but do go on and hook us up to the core's swapchain and callbacks. + if (coreInitialized) { - return false; + _interactivity.Initialize(); } - _interactivity.Initialize(); // TODO! very good chance we leak this handle const HANDLE chainHandle = reinterpret_cast(_contentIsOutOfProc() ?