microsoft / node-pty

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

Use without forking #484

Closed dustinlacewell closed 3 years ago

dustinlacewell commented 3 years ago

Is there anyway to use node-pty as a virtual terminal buffer of sorts?

I am trying to connect up https://github.com/vadimdemedes/ink a React renderer for the terminal, to telnet.

Ink takes in a NodeJS.ReadStream and a NodeJS.WriteStream which are usually stdin and stdout. I need stdin-like and stdout-like objects to that Ink can do its thing, but I can redirect data to and from telnet.

Wondering if this project would work for me.

mofux commented 3 years ago

Couldn't you just pass the telnet stream directly to Ink, without node-pty at all?

dustinlacewell commented 3 years ago

That... worked! <3