Prevent ConPTY from de-snapping the terminal (#13164)

This is a big hammer to put out this fire. We're keeping the hiding around for now, cause we think that's likely the one that the internal tests use that we really care about here. If we need to bring this back, we can.

* [x] Closes #13158
* [x] Closes #13162
* [x] Validated these both manually
* [x] `[Native]::ShowWindow([Native]::GetConsoleWindow(), 6)` still works

(cherry picked from commit 11b810e403)
Service-Card-Id: 82371517
Service-Version: 1.14
This commit is contained in:
Mike Griese
2022-05-25 15:01:36 -05:00
committed by Dustin Howett
parent 287db8a483
commit 997b4acce5

View File

@@ -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);
}