-
Notifications
You must be signed in to change notification settings - Fork 211
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
stderr? #55
Comments
Terminals don't work this way. A pty fd is, conceptually speaking, basically just a socket. There is no stdin/stdout/stderr. The parent process creates a master/slave fd pair, the parent keeps the master pty fd, and the forked child keeps the slave fd - the child then dup2's the slave fd onto stdin/stdout/stderr, so there's no way to tell stdout/stderr apart when you read from the master fd. (You can see openpty and forkpty implemented in src/unix/pty.cc for a better look at how this works). I included .stdout and .stderr properties on the Terminal object just because that's what everyone is used to from the child_process module. People might be inclined to use them out of habit, but they're purely aesthetic and don't serve any real purpose. |
Ah I see, that makes a lot more sense now. Thank you for clarifying :) |
Excuse my ignorance if there is an obvious reason for this but why does trying to get the output from stderr like so:
result in https://github.com/chjj/pty.js/blob/master/lib/pty.js#L289
Is it simply not possible to get the output from stderr or has it just not been implemented?
Thanks :)
The text was updated successfully, but these errors were encountered: