Git Product home page Git Product logo

Comments (5)

Detegr avatar Detegr commented on July 23, 2024

I think the most idiomatic way would be to change set_handler to take an Option<F> instead of F, that however would be backwards incompatible. If we want to preserve backwards compatibility, fn set_empty_handler() could do.

About the differences between operating systems, I would like to have the same behavior on all systems. I think if there's no way to make the behaviors between operating systems to be the same, it's better to leave the feature out.

from rust-ctrlc.

henninglive avatar henninglive commented on July 23, 2024

We are never going to achieve 100% the same behavior, considering the underling OS mechanisms we abstracting over are completely different. I feel like allowing for this small difference is perfectly acceptable.

On a Unix terminal, there is only one app in the foreground at a time, and only the foreground app will receive SIGINT signals. If you want the signals distributed to your children, you must do this manually. On windows the whole process group receives CTRL+C events. Considering that when you block CTRL+C you most likely don’t want it to kill your children, I feel like inheriting the block status makes sense.

from rust-ctrlc.

Detegr avatar Detegr commented on July 23, 2024

Putting it that way it indeed sounds reasonable. I would like to change the set_handler function and release a new major version for this, what do you think?

from rust-ctrlc.

henninglive avatar henninglive commented on July 23, 2024

Yeah sure, if you don’t want to wait and maybe implement some of my other suggestions. We should mention the inherence behavior in the docs.

from rust-ctrlc.

Detegr avatar Detegr commented on July 23, 2024

Yeah sorry, I read through the issues starting from the oldest one and had not read the other proposals before commenting. Implementing the other suggestions seems to be the right thing to do here.

from rust-ctrlc.

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.