If you happen to use Ruby/Rails on Windows then you've probably got annoyed at least a few times by the "Terminate batch job" prompt you get when typing Control-C at an irb or mongrel session. Even though the program already terminated after a Control-C, the prompt asks anyway and you are forced to give an answer. That's because those Ruby programs are wrapped inside batch files, which have that behaviour hard-coded into cmd.exe.
It's possible to patch cmd.exe, but if your only problem is with some Ruby scripts, you can simply get rid of the batch files and replace then by pure Ruby scripts.
In the case of irb rename
bin\irb.rb and remove the lines from the beginning of the file until
goto endofruby. For mongrel_rails delete
bin\mongrel_rails.cmd and rename
bin\mongrel_rails.rb. The steps are similar for other files. Sometimes the Ruby script is coded directly inside the batch file. Other times the batch file just invokes Ruby with another file without an extension. But be sure
.RB is appended to the
PATHEXT environment variable.
The solution is so simple and yet I took months to finally put it in practice...