Revert "Send SIGTERM on <c-c>, to more reliably kill background jobs"

Overloading SIGTERM like that causes issues; specifically if the
editor is invoked (without exec) from a wrapper script.

By sending SIGTERM to whole process group, we kill our parent process
(the wrapper script) which then sends SIGTERM to Kakoune.  By this
time Kakoune has already reset the SIGTERM handler to the default
action and terminates.

We can use a different fix for the problem that some shells don't
cancel "make", see the next patch.

This reverts commit ec44d98347.
This commit is contained in:
Johannes Altmanninger 2024-03-29 17:27:26 +01:00 committed by Maxime Coste
parent 9faad8c023
commit 5d00b80d1a

View File

@ -49,9 +49,9 @@ Client::Client(std::unique_ptr<UserInterface>&& ui,
kak_assert(key != Key::Invalid); kak_assert(key != Key::Invalid);
if (key == ctrl('c')) if (key == ctrl('c'))
{ {
auto prev_handler = set_signal_handler(SIGTERM, SIG_IGN); auto prev_handler = set_signal_handler(SIGINT, SIG_IGN);
killpg(getpgrp(), SIGTERM); killpg(getpgrp(), SIGINT);
set_signal_handler(SIGTERM, prev_handler); set_signal_handler(SIGINT, prev_handler);
} }
else if (key == ctrl('g')) else if (key == ctrl('g'))
{ {