#931402 dpkg: improperly sets up conffile examine shell session; breaks Emacs totally

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Harald Dunkel
Date:
2021-05-31 01:36:04 UTC
Severity:
important
#931402#5
Date:
2019-07-04 08:05:31 UTC
From:
To:
On the upgrade from Stretch to Buster there was a config
file conflict (with /etc/issue, but that doesn't matter).
dpkg allowed me to examine the conflict ("Z"). I could
adjust the old file using the mg editor, I could save the
config file using Ctrl-X Ctrl-S, but I could not leave mg
using Ctrl-X Ctrl-C. The Ctrl-C did not work.

AFAICT dpkg's "Z" session should set the terminal back to a
reasonable state before starting a new shell.


Regards
Harri

#931402#10
Date:
2021-02-28 18:06:30 UTC
From:
To:
I can reproduce this in just the shell that's started. Ctrl-C doesn't
seem to have any immediate effect. However once the shell is exited, the
Ctrl-C causes dpkg to terminate early.

I suspect that dpkg isn't creating a new foreground process group, so
the SIGINT from Ctrl-C is being delivered to dpkg instead of the shell
(or relevant sub-process like the editor).

Adding a setsid or setpgid call somewhere in spawn_shell and/or
show_diff would probably fix it.

#931402#15
Date:
2021-05-31 01:27:12 UTC
From:
To:
I just noticed the same, ^C gets eaten; thankfully, my editor can
do without, but this is probably severe for Emacs users.

Please see whether the fix suggested works and apply it if so,
if not, fix it somehow ;-)