Skip to content

Show/Hide Operations on ::GetConsoleWindow() do not work against Terminal through ConPTY #12570

@miniksa

Description

@miniksa

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.

Metadata

Metadata

Assignees

Labels

Area-InteractionInteracting with the vintage console window (as opposed to driving via API or hooks)Issue-BugIt either shouldn't be doing this or needs an investigation.Product-ConptyFor console issues specifically related to conptyProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions