-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
In attempting to make the Windows Terminal be the default terminal (#7414), we've discovered in testing that there are a lot of scenarios that were relying on manipulating the window handle from ::GetConsoleWindow() in one way or another to show or hide the window state.
While we strongly discourage this as it isn't guaranteed to work in a universal way across platforms and systems... and is one of the APIs we have listed as "deprecated" on docs.microsoft.com for that exact reason... we're going to make a compromise solution here to try to make it work in enough scenarios that it will maintain compatibility with existing tooling that is relying on it. (One of the primary tenets of moving to Virtual Terminal sequences and the ConPTY is to make everything work in the "universal language" that all platforms support, so we strongly resist doing things "for Windows only".)
It looks like XTWINOPS (see https://invisible-island.net/xterm/ctlseqs/ctlseqs.html) is an existing sequence that will allow us to translate the window operations coming in and send them to the remote Terminal window.
This may also work for some of the z-ordering issues of #2988 going forward.
The test case here specifically is doing:
::ShowWindow(::GetConsoleWindow(), SW_HIDE);
Or one of the other SW_* actions.