Repository: microsoft/terminal (language: cpp)

Issue:
Opening a new tab when the window is maximized causes it to restore down
### Windows Terminal version

1.14.1433.0

### Windows build number

10.0.22000.0

### Other Software

_No response_

### Steps to reproduce

1. Open Terminal.
2. Maximize the window.
3. Open a new tab.
    - It doesn't matter how; `Ctrl+T`, new tab button, new tab from profile selector menu, etc.

### Expected Behavior

A new tab is opened, and the Terminal window stays maximized.

### Actual Behavior

A new tab is opened, but the window is restored down.


Discussion / hints:
Just realized this is likely a duplicate of #13158. Thought I had looked for it in recent bug reports, but missed the one right under my nose 🤦. If so, please close this, thanks! 😅

Fix patch:
diff --git a/src/interactivity/base/InteractivityFactory.cpp b/src/interactivity/base/InteractivityFactory.cpp
index c86df116e4f..737057bda87 100644
--- a/src/interactivity/base/InteractivityFactory.cpp
+++ b/src/interactivity/base/InteractivityFactory.cpp
@@ -478,7 +478,18 @@ void InteractivityFactory::SetPseudoWindowCallback(std::function<void(bool)> fun
 // - <none>
 void InteractivityFactory::_WritePseudoWindowCallback(bool showOrHide)
 {
-    if (_pseudoWindowMessageCallback)
+    // BODGY
+    //
+    // GH#13158 - At least temporarily, only allow the PTY to HIDE the terminal
+    // window. There seem to be many issues with this so far, and the quickest
+    // route to mitigate them seems to be limiting the interaction here to
+    // allowing ConPTY to minimize the terminal only. This will still allow
+    // applications to hide the Terminal via GetConsoleWindow(), but should
+    // broadly prevent any other impact of this feature.
+    //
+    // Should we need to restore this functionality in the future, we should
+    // only do so with great caution.
+    if (_pseudoWindowMessageCallback && showOrHide == false)
     {
         _pseudoWindowMessageCallback(showOrHide);
     }


Test patch: