Yes, I've been annoyed by that as well.
But what if you wanted to kill just the child and keep the parent running?
Obviously, the best thing to do is to just ask whether you wanted to kill them both or instead wanted to leave the parent running. Which is why "superior" operating systems do just that:
Terminate batch job (Y/N)?
Except that gets annoying as well. :)
Other than the case of system in a loop, requiring two CTRL-Cs is a reasonable compromise way of letting you say "kill them both" while still allowing you to say "just kill the child".
Which leads to the most annoying thing about the "Terminate batch job (Y/N)?" question: It interprets CTRL-C as "No"! Grr.
In the case of system in a loop, it is probably a good idea to notice that your child was terminated with SIGINT and prompt the user or even just sleep for a fraction of a second so that one can get that second CTRL-C in fast enough.
- tye
In reply to Re: system() requires double ctrl-c (cases)
by tye
in thread system() requires double ctrl-c
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |