Git Product home page Git Product logo

Comments (10)

mitchellh avatar mitchellh commented on July 1, 2024

Also, this is with 0.4.1

from childprocess.

jarib avatar jarib commented on July 1, 2024

Right it's a regression in 0.4.1. Looking into it.

from childprocess.

mitchellh avatar mitchellh commented on July 1, 2024

Thanks. Let me know if I can help in any way, I tried to investigate further but couldn't figure it out.

from childprocess.

jarib avatar jarib commented on July 1, 2024

The problem is essentially that we're now (since 0.4.1) letting the child process have it's own process group. This was done to fix issue #66 / #67, but it breaks tty/stdin like you point out.

I tried experimenting with tcsetpgrp(3), but couldn't make it work. I'll take another stab at it tomorrow.

Also need to find a way to spec this that doesn't involve manual typing into the terminal.

from childprocess.

mitchellh avatar mitchellh commented on July 1, 2024

HAHAH (at your last sentence).

As an interim, could we have an option to not create a new process group?

from childprocess.

jarib avatar jarib commented on July 1, 2024

OK - this should now work on master:

p = ChildProcess.build("ruby", "-e", "p STDIN.tty?; p STDIN.gets")
p.io.inherit!
p.keep_pgid = true if p.kind_of?(ChildProcess::Unix::Process)
p.start
p.wait

I'd really like to keep platform-specific options out of the API, so hopefully it'll be gone ASAP :)

from childprocess.

mitchellh avatar mitchellh commented on July 1, 2024

I totally understand. I don't know if you would mind maybe scoping it to note that it is temporary and cutting a release with it? I can do a #respond_to? check on it but require it for some upcoming things (and require the fixes in 0.4.1).

Thanks!

from childprocess.

jarib avatar jarib commented on July 1, 2024

All right, pushed as 0.4.2.

from childprocess.

jarib avatar jarib commented on July 1, 2024

I've pushed 0.5.0 which removes the keep_pgid flag and reverts the default behaviour to what it was pre 0.4.1.

Anyone who wants the 0.4.1-0.4.2 behaviour must explicitly enable it:

proc = ChildProcess.build(...)
proc.leader = true
proc.start

from childprocess.

mitchellh avatar mitchellh commented on July 1, 2024

I agree this is the correct solution. Thank you!

from childprocess.

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.