For those of us with a long Unix/Linux history, one of the most cherished, useful, and powerful key combinations is Ctrl-C. Doesn’t it just give you a satisfying feeling to kill that process that is running amok, spitting loads of misguided output to your xterm? Feels good, doesn’t it? Sometimes holding the control key and hitting “C” is preceded by an utterance of “Crap!” or some other expression of high emotion, and when that prompt comes back, as if saying, “You rang?”, I know I am totally in control, “C” that is.
OK, this article is not all about sending SIGINTs… That would be pretty boring. It’s about something I miss terribly: actually seeing ^C just before the process is killed. There’s something beautiful and informative about the letter C preceded by our beloved caret. You might say, “Why? Don’t you realize you hit Ctrl-C? Why do you care to see it?” I’ll tell you…
One example is when I try running something several times, interrupting it some of those times, and I forget whether the process naturally (or unnaturally) just quit or if I did hit Ctrl-C (it’s such a reflex that it’s often pretty subconscious). In Linux, I often find myself looking for an extra blank line (which is the only feeble trace of the Ctrl-C), but that’s just not a very positive indication! I don’t know about you, but I want to know for sure. Some programs tell you in no uncertain terms when you interrupt them (like Python scripts, portage, etc.), but then there are some that silently “go away” with no sign that anything happened (e.g. genkernel). Not only that, but why not echo the Ctrl-C? Guess what? Other variants of Unix have done it for years (e.g. FreeBSD). Why did Linux choose to forgo the ^C? I don’t know, and Googling ™ for it tells me little if not nothing.
What I do know is that I am on a quest to get back ^C, ^Z, etc. After chasing a red herring or two, I think I’m on it. I am recompiling my Linux kernel right now, and after a one-line change to “drivers/char/n_tty.c”, I have high hopes that I will have ^C back.