4 ms·
Abstract: In UNIX terminal sessions, you usually have a key like C-c (Control-C) to immediately end whatever program you have running in the foreground. This s
by teddyh 11y ago
Abstract:
In UNIX terminal sessions, you usually have a key like C-c (Control-C) to immediately end whatever program you have running in the foreground. This should work even when the program you called has called other programs in turn. Everything should be aborted, giving you your command prompt back, no matter how deep the call stack is.
Basically, it’s trivial. But the existence of interactive applications that use SIGINT and/or SIGQUIT for other purposes than a complete immediate abort make matters complicated, and – as was to expect – left us with several ways to solve the problems. Of course, existing shells and applications follow different ways.
This web page outlines different ways to solve the problem and argues that only one of them can do everything right, although it means that we have to fix some existing software.