with-authinfo-kludge: Do job-control to make interrupt characters work.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 21 Sep 2017 07:51:50 +0000 (08:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 21 Sep 2017 08:32:33 +0000 (09:32 +0100)
commit8956a632bf1ee65e0af794c4ba0486bf849db339
tree02b4d7a7404277645bf1edcebbd18c92688ce10d
parent3b0440008beb26d19f97d88e02e21d75a1c6e6f3
with-authinfo-kludge: Do job-control to make interrupt characters work.

Terminal-based newsreaders use terminal interrupt characters for their
own purposes, i.e. slrn(1) arranges that C-g is the `VINTR' character
(i.e., it sends `SIGINT' to the foreground process group).  This is bad
unless we take evasive action: it makes `slrn' go ding and cancel some
UI action, but it also wipes out `with-authinfo-kludge' and its various
helper processes, and brings the parent shell back into the foreground
where it fights `slrn' over the terminal.

Avoid this by running the client in a separate process group, pushing it
into the foreground, and proxying signals and foregroundness back and
forth to keep the shell happy.  It's all a bit ugly and desperate, but
it works well in practice and doesn't involve ignoring signals
everywhere (which was my first attempt at solving this bug).
with-authinfo-kludge