ConPTY Version probing #23414

Open
opened 2026-01-31 08:41:31 +00:00 by claunia · 0 comments
Owner

Originally created by @patrickbkr on GitHub (Jul 7, 2025).

This is more of a question than a feature request.

I'm currently working on adding PTY support to libuv. Bundling ConPTY is not an option, so I have to work with the version kernel32.dll gives me. There are some relevant developments in the last few years/months.

  • Support for Overlapped IO (#17510)
  • ConptyReleasePseudoConsole (#14544)
  • Probably a few more

How do I know which features are available in the ConPTY version bundled with Windows? Is there some version number I can retrieve? Is there a Matrix of Windows version and ConPTY version?

Also: Is there any documentation on how to use these older ConPTY versions? I find it pretty difficult to find any in-depth information on this. For example, here are some of the questions I've stumbled over:

  • Do I have to use synchronous pipes for in and out? (I think: Yes in older versions, no in recent versions.)
  • Can I use the same (bidirectional) pipe for PTY in and out? (I think: Yes.)
  • Do I have to perform stdin writing and stdout reading each on their own thread? (I think: No.)
  • What's happening when I close the pty write handle? (I think: ConPTY sends a CTRL-C to the process.)
  • How do I properly shut down a ConPTY session? (According to this comment and this remark, it's a pretty delicate dance I have to perform.)
Originally created by @patrickbkr on GitHub (Jul 7, 2025). This is more of a question than a feature request. I'm currently working on adding [PTY support to libuv](https://github.com/libuv/libuv/pull/4802). Bundling ConPTY is not an option, so I have to work with the version kernel32.dll gives me. There are some relevant developments in the last few years/months. - Support for Overlapped IO ([#17510](https://github.com/microsoft/terminal/pull/17510)) - `ConptyReleasePseudoConsole` ([#14544](https://github.com/microsoft/terminal/pull/14544)) - Probably a few more How do I know which features are available in the ConPTY version bundled with Windows? Is there some version number I can retrieve? Is there a Matrix of Windows version and ConPTY version? Also: Is there any documentation on how to use these older ConPTY versions? I find it pretty difficult to find any in-depth information on this. For example, here are some of the questions I've stumbled over: - Do I have to use synchronous pipes for in and out? (I think: [Yes](https://learn.microsoft.com/en-us/windows/console/createpseudoconsole#parameters) in older versions, no in recent versions.) - Can I use the same (bidirectional) pipe for PTY in and out? (I think: Yes.) - Do I have to perform stdin writing and stdout reading each on their own thread? (I think: No.) - What's happening when I close the pty write handle? (I think: ConPTY sends a `CTRL-C` to the process.) - How do I properly shut down a ConPTY session? (According to [this comment](https://github.com/microsoft/terminal/discussions/15006#discussioncomment-5339341) and [this remark](https://learn.microsoft.com/en-us/windows/console/closepseudoconsole#remarks), it's a pretty delicate dance I have to perform.)
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 08:41:32 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23414