From c6899e98e10da37e8034e0f0cfd0904091ad34e5 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Sat, 15 Jun 2024 04:53:19 +0200 Subject: [PATCH] Fix `Ctrl-C` behavior within the Readline prompt (#1342) [tk: fixed regression with the `Enter` key] --- NEWS.adoc | 1 + src/prompt.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS.adoc b/NEWS.adoc index 15280d6fa..1fd2fbe46 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -7,6 +7,7 @@ master Bug fixes: - Fix various issues with `diff.noprefix` and `--no-prefix`. + - Fix `Ctrl-C` behavior within the Readline prompt. (#1342) Improvements: diff --git a/src/prompt.c b/src/prompt.c index 7463d46cb..7d858e371 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -499,6 +499,7 @@ read_prompt(const char *prompt) curs_set(1); if (signal(SIGINT, sigint_absorb_handler) == SIG_ERR) die("Failed to setup sigint handler"); + noraw(); cbreak(); line = readline(prompt); raw();