diff --git a/src/cascadia/TerminalApp/AppLogic.cpp b/src/cascadia/TerminalApp/AppLogic.cpp index e9b22b4b1dd..ba6ae4feaf1 100644 --- a/src/cascadia/TerminalApp/AppLogic.cpp +++ b/src/cascadia/TerminalApp/AppLogic.cpp @@ -376,7 +376,11 @@ namespace winrt::TerminalApp::implementation } _dialog = dialog; - + // GH#12622: After the dialog is displayed, always clear it out. If we + // don't, we won't be able to display another! + const auto cleanup = wil::scope_exit([this]() { + _dialog = nullptr; + }); // IMPORTANT: This is necessary as documented in the ContentDialog MSDN docs. // Since we're hosting the dialog in a Xaml island, we need to connect it to the // xaml tree somehow.