Bug#599007: apt-get can't be interrupted with Ctrl+C nor Ctrl-\ anymore
On Wed, Oct 06, 2010 at 03:58:41PM +0200, Michael Vogt wrote:
> > It appears that since a recent upgrade, you can't interrupt apt runs
> > anymore.
> [..]
>
> This is a bug in the code, it looks like this is a regression caused
> by setting the termios rtt var via "rtt.c_lflag |= ISIG". This fixed
> making it possible to background dpkg, but apparently it broke
> ctrl-c. Which is odd given that the documentation says that is is used
> to enable signals.
Uhm, 1. it is set by default, 2. it indeed enables recognition of signals.
I remember disabling it in a program of mine:
http://angband.pl/viewvc/kbtin/trunk/user_tty.c?view=markup
and after checking again, it does work as in the documentation.
Quoting glibc's docs:
# -- Macro: tcflag_t ISIG
# This bit controls whether the INTR, QUIT, and SUSP characters are
# recognized. The functions associated with these characters are
# performed if and only if this bit is set. Being in canonical or
# noncanonical input mode has no affect on the interpretation of
# these characters.
#
# You should use caution when disabling recognition of these
# characters. Programs that cannot be interrupted interactively are
# very user-unfriendly. If you clear this bit, your program should
# provide some alternate interface that allows the user to
# interactively send the signals associated with these characters,
# or to escape from the program.
With that bit clear, Ctrl-C produces a character 0x03. With it set, it
sends SIGINT.
I didn't look at the apt code, but there must be more to it than merely
setting this flag.
--
1KB // Microsoft corollary to Hanlon's razor:
// Never attribute to stupidity what can be
// adequately explained by malice.
Reply to: