remove SIGUSR1 escape; pkill <editor> is the standard recovery
All checks were successful
CI Code / Check coding style (pull_request) Successful in 32s
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Linux (debian) (pull_request) Successful in 4m30s
CI Code / Code Coverage (pull_request) Successful in 3m15s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m36s
CI Code / Linux (arch) (pull_request) Successful in 6m21s

The SIGUSR1 -> editor_emergency_kill wiring was a contrived escape
hatch. A console user with a stuck editor reaches for kill / pkill /
SIGKILL on the editor, not undocumented signals on the chat client.
editor_emergency_kill() stays for the internal Ctrl-Z abort path.
This commit is contained in:
2026-05-31 15:12:40 +03:00
parent 3f91cbc8b0
commit b90dec5be3
3 changed files with 3 additions and 15 deletions

View File

@@ -2638,7 +2638,8 @@ static const struct cmd_t command_defs[] = {
CMD_DESC(
"Spawn external editor to edit message. "
"After editing the inputline may appear empty. Press enter to send the text anyways. "
"Use /executable to set your favourite editor." )
"Use /executable to set your favourite editor. "
"Ctrl-Z in the editor aborts the session and returns to Profanity." )
},
{ CMD_PREAMBLE("/correct-editor",

View File

@@ -20,7 +20,6 @@
#include <string.h>
#include <glib.h>
#include <glib-unix.h>
#include "profanity.h"
#include "common.h"
@@ -219,15 +218,6 @@ sigterm_handler(int sig)
force_quit = TRUE;
}
// SIGUSR1 escape for an alive-but-stuck editor (WUNTRACED can't catch it).
// Dispatched in the main loop. Trigger: `pkill -USR1 profanity`.
static gboolean
_emergency_resume_handler(gpointer data)
{
editor_emergency_kill();
return G_SOURCE_CONTINUE;
}
static void
sigtstp_handler(int sig)
{
@@ -252,7 +242,6 @@ _init(char* log_level, char* config_file, char* log_file, char* theme_name)
signal(SIGWINCH, ui_sigwinch_handler);
signal(SIGTERM, sigterm_handler);
signal(SIGHUP, sigterm_handler);
g_unix_signal_add(SIGUSR1, _emergency_resume_handler, NULL);
if (pthread_mutex_init(&lock, NULL) != 0) {
log_error("Mutex init failed");
exit(1);

View File

@@ -16,9 +16,7 @@
gboolean launch_editor(gchar* initial_content, void (*callback)(gchar* content, void* data), void* user_data);
// SIGUSR1 escape: SIGTERM the editor child. Use when WUNTRACED can't catch
// it (alive but stuck). Wired in profanity.c.
void editor_emergency_kill(void);
void editor_emergency_kill(void); // SIGCONT+SIGTERM the editor child
// TRUE if editor child is STOPPED (Ctrl-Z / :stop / gdb-attach). Does not
// reap; g_child_watch keeps handling exit.