Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Microsoft’s new ConPTY API on Windows versions which support it (i.e. Fall 2018 and newer) #152

Open
ExE-Boss opened this issue Aug 19, 2018 · 11 comments

Comments

@ExE-Boss
Copy link

ExE-Boss commented Aug 19, 2018

https://blogs.msdn.microsoft.com/commandline/2018/08/02/windows-command-line-introducing-the-windows-pseudo-console-conpty/

As winpty is one of the most commonly used PTY implementations in Windows programs which need PTY functionality, to reduce work for third parties which rely on winpty, it would be a good idea if the winpty library would simply become a translation layer on Windows 10 Fall 2018 update and newer by using the ConPTY detection mechanism outlined in the linked article.


Related: microsoft/node-pty#216

@rprichard
Copy link
Owner

There should probably be a layer somewhere that chooses between ConPTY and winpty's current agent-based scraping. It could make sense to just put that layer in winpty itself. I'll try to work on this sometime.

@Tyriar
Copy link

Tyriar commented Aug 23, 2018

There should probably be a layer somewhere that chooses between ConPTY and winpty's current agent-based scraping.

Yes this is the strategy I'm using for node in microsoft/node-pty#216, I'll detect the feature set and either run conpty or fallback to winpty.

@zadjii-msft
Copy link

@rprichard Lemme know if you need any help adding support for conpty, or if you find any bugs or gaps in functionality. I'm happy to help in any way I can :)

@lars18th
Copy link

Hi,

My two cents about this:

  • Some programs (or several) use the CygTerm mode to interact with the Cygwin console Apps. The basis it's the cthelper.exe process.
  • As the new Win10 ConAPI support PTY for any Windows/WSL console Apps, now it's possible to execute all Cygwin/SSH/Win32/WSL console Apps inside the WSL Bash shell.
  • Then, you can prepare a "simple" modification of the cthelper.exe that runs win the WSL BASH SHELL, instead of the CygWin BASH (or with any other native Win10 shell).
  • And with this change any program that has support for the CygTerm CTHELPER will obtain console support.

So, in summary: Why not create a new cthelper-wsl.exe?

What you think?

@Mart-Bogdan
Copy link

I'd like to add, that testing if api functions present isn't sufficient, new console could be disabled in settings ("Use legacy console") by windows admin user. For compatibility I guess.

Need to check about this option.

@segrey
Copy link

segrey commented Apr 4, 2019

@rprichard Do you plan to implement it in winpty?

@Stanzilla
Copy link

@rprichard are you still maintaining this or is there an alternative?

@ForNeVeR
Copy link

ForNeVeR commented Sep 6, 2021

What's the reason for using winpty if ConPTY is available, though? From what I can see, it provides a similar interface by itself.

@Tyriar
Copy link

Tyriar commented Sep 6, 2021

@ForNeVeR support for Windows before Windows 10

@dumblob
Copy link

dumblob commented Sep 22, 2021

Just curious - do you know of or assume large amount of pre-Windows 10 installations? Win 11 is knocking on the door, so I'm not sure this will be that important soon.

@k-takata
Copy link

Cygwin itself now supports ConPTY (it is disabled in MSYS2 by default, though).
Supporting it in winpty might not be so important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests