Repository: microsoft/terminal (language: cpp)

Issue:
press atl + shift + D on setting page, then wt will crash
### Windows Terminal version

1.14.143

### Windows build number

10.0.19044.0

### Other Software

_No response_

### Steps to reproduce

press atl + shift + D on setting page

### Expected Behavior

_No response_

### Actual Behavior

crash


Discussion / hints:

Fix patch:
diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp
index e842bc8aa83..5a7814ad604 100644
--- a/src/cascadia/TerminalApp/TerminalPage.cpp
+++ b/src/cascadia/TerminalApp/TerminalPage.cpp
@@ -1822,9 +1822,17 @@ namespace winrt::TerminalApp::implementation
         // Instead, let's just promote this first split to be a tab instead.
         // Crash avoided, and we don't need to worry about inserting a new-tab
         // command in at the start.
-        if (!focusedTab && _tabs.Size() == 0)
+        if (!focusedTab)
         {
-            _CreateNewTabFromPane(newPane);
+            if (_tabs.Size() == 0)
+            {
+                _CreateNewTabFromPane(newPane);
+            }
+            else
+            {
+                // The focused tab isn't a terminal tab
+                return;
+            }
         }
         else
         {


Test patch: