node-pty icon indicating copy to clipboard operation
node-pty copied to clipboard

Embed latest ConPTY implementation

Open Eugeny opened this issue 4 years ago • 3 comments

Microsoft ships the bleeding edge ConPTY client-side implementation with Windows Terminal, which includes features like mouse support. Only much later does it get pushed into Windows baseline which means node-pty doesn't get these features until then.

Do we want to pull these sources into node-pty?

Their code is MIT licensed.

Note: this also requires building a custom conhost binary

Eugeny avatar Aug 15 '21 21:08 Eugeny

I thought about doing this but I didn't really want to take on the potential instability and additional build complexity that comes with it.

Tyriar avatar Aug 17 '21 12:08 Tyriar

As an optional addition we could support it, maybe by adding options to point to the conhost binary. I'm not sure we would want to take on burden for maintaining extra build targets or something.

Tyriar avatar Oct 21 '21 19:10 Tyriar

As an optional addition we could support it, maybe by adding options to point to the conhost binary

I don't know whether that's still considered, but I think it could be useful.

While currently new conpty/conhost is not available publicly, the Windows Terminal does embed a new one, and their build artifacts (but not the release package) currently does include conpty.dll and OpenConsole.exe.

So an adventurous user could use those, and for node-pty it could be an opportunity to test the integration with an out-of-tree conpty (at PATH maybe?) before it becomes available publicly (or maybe in-tree where conpty.dll and openconsole.exe are placed manually together with winpty.dll).

One main advantage I think a new conpty/conhost has is support for mouse (wheel?) events in console applications, which currently doesn't work at the vscode terminal.

avih avatar Aug 24 '23 00:08 avih