From cf4870c93e274ad7f0620f86241b85de9a2adc76 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Fri, 21 Aug 2020 19:37:14 +0430 Subject: [PATCH] LibLine: Do not ignore Ctrl-C when buffer is empty I am told that this is how people test their shells. That's bizarre to me, but sure :^) --- Libraries/LibLine/Editor.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index 458f08d30d..815b33ee39 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -563,17 +563,12 @@ void Editor::handle_interrupt_event() } } - if (!m_buffer.is_empty()) { - fprintf(stderr, "^C"); - fflush(stderr); - } + fprintf(stderr, "^C"); + fflush(stderr); if (on_interrupt_handled) on_interrupt_handled(); - if (m_buffer.is_empty()) - return; - m_buffer.clear(); m_cursor = 0;