Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Console "sharing" CTRL + C

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)

like image 361
Benedikt B Avatar asked Jul 28 '26 17:07

Benedikt B


1 Answers

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.

like image 124
Franck Verrot Avatar answered Jul 30 '26 07:07

Franck Verrot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!