uv_spawn: PTY support #573

Closed
piscisaureus opened this Issue Oct 4, 2012 · 3 comments

Projects

None yet

4 participants

@piscisaureus
Member

Add an option to uv_spawn to open a PTY.

Example code of how to create a pty can be found in node 0.4 and pty.js.

Open questions/problems:

  • Do we define a separate uv_pty_t, or can we piggyback this onto uv_pipe_t?
  • Typically you wouldn't want to open multiple ptys; instead you'd attach fd 0-2 all to the same pty. There currently is no room in the API for that.
  • There is no way to do this on Windows. Do we make it return UV_ENOSYS, or do we just create pipes?
@Sharpie
Sharpie commented Oct 30, 2012

There is no way to do this on Windows. Do we make it return UV_ENOSYS, or do we just create pipes?

One interesting workaround on the Windows side:

https://github.com/rprichard/winpty

A bit clunky as it spawns a new process that tries to generate a PTY stream by scraping a hidden console window. More discussion and alternative approaches can be found on the Cygwin mailing list.

Maybe not a solution that is solid enough to build into libuv proper---but perhaps good enough to leave an opening for those who can live with the limitations.

@rikarends

+1 Need this to use vanilla node for serving terminals. No binary extensions!

@saghul
Member
saghul commented Nov 26, 2014

Closing old stalled issues, please reopen at https://github.com/libuv/libuv if still needed.

@saghul saghul closed this Nov 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment