From 0a8770ac7d382df8976b2448fccc6cfe434cd4d1 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 12 Apr 2026 21:47:58 +0200 Subject: GTK: SIGTERM/SIGHUP always terminates the program and dumps recovery files * SIGTERM used to insert the ^KCLOSE key macro. However with the default ^KCLOSE macro, which inserts `EX`, this may fail to terminate the editor if buffers are modified. If the process is consequently killed by a non-ignorable signal, we may still loose data. * SIGTERM is used to gracefully shut down, so we now always terminate. Since we have recovery files, they are now dumped before terminating. This makes sure that recovery files are more up-to-date during unexpected but gracefull terminations. * The same functionality is planned on Curses, but requires more fundamental changes (TODO). --- src/core-commands.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core-commands.c') diff --git a/src/core-commands.c b/src/core-commands.c index 528fa64..2dc1da7 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -2194,6 +2194,8 @@ teco_state_ecommand_flags(teco_machine_main_t *ctx, GError **error) * They are removed automatically when no longer required, * but may be left around when the \*(ST crashes or terminates * unexpectedly. + * During graceful shutdowns (\fBSIGTERM\fP etc.) recovery + * files may be dumped immediately even before the interval expires. * After changing the interval, the new value may become * active only after the previous interval expires. * Recovery files are not dumped in batch mode. -- cgit v1.2.3