Giter Site home page Giter Site logo

stderr? about pty.js HOT 2 CLOSED

jamesrwhite avatar jamesrwhite commented on August 21, 2024
stderr?

from pty.js.

Comments (2)

chjj avatar chjj commented on August 21, 2024

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.

from pty.js.

jamesrwhite avatar jamesrwhite commented on August 21, 2024

Ah I see, that makes a lot more sense now. Thank you for clarifying :)

from pty.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.