Any documentation of the command line parameters of conhsot #2815

Closed
opened 2026-01-30 23:05:57 +00:00 by claunia · 7 comments
Owner

Originally created by @Biswa96 on GitHub (Jul 17, 2019).

With the pseudo console feature conhost.exe now accepts many 'long' command line options, for example, height, width, signal, server, feature etc. Is there any official documentations about it? Another related thing. The --server option takes \Device\ConDrv\Server handle. Is there any docs about all the ConDrv interfaces hierarchy?

Originally created by @Biswa96 on GitHub (Jul 17, 2019). With the pseudo console feature `conhost.exe` now accepts many 'long' command line options, for example, height, width, signal, server, feature etc. Is there any official documentations about it? Another related thing. The `--server` option takes `\Device\ConDrv\Server` handle. Is there any docs about all the ConDrv interfaces hierarchy?
Author
Owner

@zadjii-msft commented on GitHub (Jul 17, 2019):

Nope, there's no documentation. We're not really making any commitment that those options will stay the same. They're supposed to be an "implementation detail" of conpty. I would not take any explicit dependencies on them.

I believe we don't have any official documentation on ConDrv either, as that's also supposed to be an implementation detail.

@zadjii-msft commented on GitHub (Jul 17, 2019): Nope, there's no documentation. We're not really making any commitment that those options will stay the same. They're supposed to be an "implementation detail" of conpty. I would _not_ take any explicit dependencies on them. I believe we don't have any official documentation on ConDrv either, as that's also supposed to be an implementation detail.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 17, 2019):

Correct. T

@DHowett-MSFT commented on GitHub (Jul 17, 2019): Correct. T
Author
Owner

@Biswa96 commented on GitHub (Jul 17, 2019):

I have tested some programs using those conhost options (here) and it works well with mintty + cmd or wsl, instead of using pseduo console APIs (or waiting for cygwin devs). So, docs may be useful for reference. Also the Win32 port of OpenSSH uses those options (here).

@Biswa96 commented on GitHub (Jul 17, 2019): I have tested some programs using those conhost options ([here](https://github.com/Biswa96/wslbridge2/tree/master/rawpty)) and it works well with mintty + cmd or wsl, instead of using pseduo console APIs (or waiting for cygwin devs). So, docs may be useful for reference. Also the Win32 port of OpenSSH uses those options ([here](https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/win32compat/win32_pty.c)).
Author
Owner

@zadjii-msft commented on GitHub (Jul 17, 2019):

Oh man ssh should probably not be doing that anymore. They were using those args when conpty was in a pretty early pre-release state, but now that it's available as an actual API, the only supported scenario is using the API.

Is there any particular reason you wish to avoid using the pseudoconsole API's?

@zadjii-msft commented on GitHub (Jul 17, 2019): Oh man ssh should probably not be doing that anymore. They were using those args when conpty was in a pretty early pre-release state, but now that it's available as an actual API, the only _supported_ scenario is using the API. Is there any particular reason you wish to avoid using the pseudoconsole API's?
Author
Owner

@Biswa96 commented on GitHub (Jul 17, 2019):

Is there any particular reason you wish to avoid using the pseudoconsole API's?

Due to limited knowledge of how conhost works. I have tried mintty using those APIs but it does not work. I think cygwin has to implement those. But who wants to wait...

Your question gives me another query. In resize pseudo console, --signal takes 8 flag. Is it possible to add more flags for other console variables like char size, zoom in-out, fade in-out etc.?

@Biswa96 commented on GitHub (Jul 17, 2019): > Is there any particular reason you wish to avoid using the pseudoconsole API's? Due to limited knowledge of how conhost works. I have tried mintty using those APIs but it does not work. I think cygwin has to implement those. But who wants to wait... Your question gives me another query. In resize pseudo console, `--signal` takes `8` flag. Is it possible to add more flags for other console variables like char size, zoom in-out, fade in-out etc.?
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 17, 2019):

Due to limited knowledge

@Biswa96, limited knowledge is a reason to use the API, not to go taking dependencies on implementation details that we are free to change at any moment. 😄

@DHowett-MSFT commented on GitHub (Jul 17, 2019): > Due to limited knowledge @Biswa96, limited knowledge is a reason to *use* the API, not to go taking dependencies on implementation details that we are free to change at any moment. :smile:
Author
Owner

@gavenkoa commented on GitHub (Oct 11, 2025):

--headless is commonly used:

https://stackoverflow.com/questions/45549442/use-cmd-c-but-hide-the-console-window/

If --headless is used from cmd.exe environment one needs to start separate console env to properly hide:

start conhost --headless emacs --daemon

General syntax to run CMD with ARGS using conhost:

conhost.exe [--headless] CMD ARGS...

It is useful to override Windows Console for heavy console oriented programs, like Far manager:

C:\Windows\System32\conhost.exe C:\opt\scoop\apps\far\current\Far.exe
@gavenkoa commented on GitHub (Oct 11, 2025): `--headless` is commonly used: https://stackoverflow.com/questions/45549442/use-cmd-c-but-hide-the-console-window/ If `--headless` is used from cmd.exe environment one needs to start separate console env to properly hide: start conhost --headless emacs --daemon General syntax to run `CMD` with `ARGS` using conhost: conhost.exe [--headless] CMD ARGS... It is useful to override Windows Console for heavy console oriented programs, like Far manager: C:\Windows\System32\conhost.exe C:\opt\scoop\apps\far\current\Far.exe
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2815