Code Monkey home page Code Monkey logo

Comments (5)

vtjnash avatar vtjnash commented on July 18, 2024

Probably also a duplicate of #2062 where the dup2 behavior interferes with the correct behavior of native libraries and uv_spawn also and that native libraries can corrupt libuv state (fwiw, Julia always passes in dup of stdio handles instead of 0,1,2 so that those issues do not occur)

from libuv.

saghul avatar saghul commented on July 18, 2024

Similar yeah. I guess my reason to think this one is slightly different is that we have dedicated functionality to interact with the outside world, but it has some iinteresting caveats.

from libuv.

bnoordhuis avatar bnoordhuis commented on July 18, 2024

We should reset orig_termios_fd if the tty handle is closed, since the fd will become invalid.

#4399 - imperfect but ceteris paribus an improvement

from libuv.

vtjnash avatar vtjnash commented on July 18, 2024

the internal orig_termios_fd reference will point to the duplicated fd, not the real one

To be clear, my recollection is that libuv then calls dup2 to destroy the original fd so that it can point to the "real" one not the duplicated one (which is the bug in #2062)

Secondly, should we add a uv_tty_capture_mode(uv_os_handle_t fd) function, so that this applications can avoid having this code be conditional on whatever pty object first happens to used with it, and so the user could capture the state of fd 0 explicitly instead?

from libuv.

saghul avatar saghul commented on July 18, 2024

Not sure, I find the current behavior good, minus a specific case...

The PR Ben made solves it already, so I guess we can get more creative if / when we need to?

from libuv.

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.