When I open two Rails consoles and press CTRL+C in one of them, it will be sent to both consoles.
Why is that and how can I prevent this?
(Rails 4.2.0)
Rails 4.1 introduced Spring, which speeds up the booting process of some Rails' components (like the console).
Each console is now trying to reach the spring server to check whether or not an existing Rails app is already running. If it finds one, it does a "warm run" as there's no need to boot the app.
Hitting Ctrl+C sends the SIGINT signal to Spring (and you can see ^C on all your terminals running a console connected to that server) but Spring ignore them to avoid killing the master server.
AFAICT from this analysis, there's nothing you can do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With