From 12e14ebba6b6fe111829cac357b48154e769d778 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 18 Jan 2021 08:49:21 +0000 Subject: ash: alter handling of interactive ^C Upstream commit 4ac35a30d (ash: make interactive ^C break out of PS2 mode) doesn't work for WIN32. It causes the shell to exit when ^C is pressed on the command line. Call raise_interrupt() instead of raise(SIGINT). --- shell/ash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index 780900b40..b9bdd64e5 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11388,9 +11388,11 @@ preadfd(void) nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ); if (nr == 0) { /* ^C pressed, "convert" to SIGINT */ - write(STDOUT_FILENO, "^C", 2); # if !ENABLE_PLATFORM_MINGW32 + write(STDOUT_FILENO, "^C", 2); raise(SIGINT); +# else + raise_interrupt(); # endif if (trap[SIGINT]) { buf[0] = '\n'; -- cgit v1.2.3-55-g6feb