remove SIGUSR1 escape; pkill <editor> is the standard recovery
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Code Coverage (pull_request) Successful in 3m33s
CI Code / Linux (debian) (pull_request) Successful in 4m47s
CI Code / Linux (ubuntu) (pull_request) Successful in 5m1s
CI Code / Linux (arch) (pull_request) Successful in 6m59s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Code Coverage (pull_request) Successful in 3m33s
CI Code / Linux (debian) (pull_request) Successful in 4m47s
CI Code / Linux (ubuntu) (pull_request) Successful in 5m1s
CI Code / Linux (arch) (pull_request) Successful in 6m59s
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:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user