microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.47k stars 242 forks source link

Embed latest ConPTY implementation #490

Open Eugeny opened 3 years ago

Eugeny commented 3 years ago

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

Tyriar commented 3 years ago

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 commented 2 years ago

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.

avih commented 1 year ago

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.