From e413ed8e1d8a60e44f07dd8d8080d783ce009039 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 9 Oct 2022 16:28:06 +0200 Subject: [PATCH] execute: show "Cancelled" instead of "Error" when the user hits ^C (The "Cancelled" is shown with a red background, like an error, but that is needed so that do_undo() will be called afterward.) --- src/files.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index 9715face..3d95002f 100644 --- a/src/files.c +++ b/src/files.c @@ -1151,8 +1151,8 @@ void execute_command(const char *command) /* If the command failed, show what the shell reported. */ if (WIFEXITED(command_status) == 0 || WEXITSTATUS(command_status)) - statusline(ALERT, _("Error: %s"), !WIFSIGNALED(command_status) && - openfile->current->prev && + statusline(ALERT, WIFSIGNALED(command_status) ? _("Cancelled") : + _("Error: %s"), openfile->current->prev && strstr(openfile->current->prev->data, ": ") ? strstr(openfile->current->prev->data, ": ") + 2 : "---"); else if (should_pipe && pid_of_sender > 0 &&