nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e413ed8e1d8a60e44f07dd8d8080d783ce009039
parent 858f41144729d0271c0d46433fa07e7e27fa3040
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  9 Oct 2022 16:28:06 +0200

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.)

Diffstat:
Msrc/files.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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 &&