How to programmatically detect/force console host? #19220

Open
opened 2026-01-31 06:37:16 +00:00 by claunia · 0 comments
Owner

Originally created by @dts350z on GitHub (Jan 16, 2023).

So I have a console application that uses SetConsoleWindowInfo, etc. which does nothing in windows terminal.

Windows Terminal is now the default in windows 11, and while users can set ALL console hosts to be windows terminals or the old console, I don't see anyway for console applications to determine which is selected or to force the right choice for the API in use.

"Let Windows Decide" doesn't seem to do anything except make everything windows terminals.

I also don't see a 1:1 equivalency between the old API and Virtual Terminal Escape sequences. E.g. one can set the width, but not the height?

Please advise.

Originally created by @dts350z on GitHub (Jan 16, 2023). So I have a console application that uses SetConsoleWindowInfo, etc. which does nothing in windows terminal. Windows Terminal is now the default in windows 11, and while users can set ALL console hosts to be windows terminals or the old console, I don't see anyway for console applications to determine which is selected or **to force the right choice for the API in use**. "Let Windows Decide" doesn't seem to do anything except make everything windows terminals. I also don't see a 1:1 equivalency between the old API and Virtual Terminal Escape sequences. E.g. one can set the width, but not the height? Please advise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19220