From 1a7af4d677d1659e7fb95e7704ff92f9bdc11a7f Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Wed, 22 Apr 2020 14:18:17 +0430 Subject: LibLine: Do not ignore ^C and do not finish() after interrupt --- Libraries/LibLine/Editor.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Libraries/LibLine') diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index 43fc388d34..f355c09417 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -152,16 +152,18 @@ String Editor::get_line(const String& prompt) if (m_was_resized) continue; - m_was_interrupted = false; + finish(); + continue; + } - if (!m_buffer.is_empty()) - printf("^C"); + m_was_interrupted = false; - m_buffer.clear(); - m_cursor = 0; - } + if (!m_buffer.is_empty()) + printf("^C"); - finish(); + m_buffer.clear(); + m_cursor = 0; + m_refresh_needed = true; continue; } perror("read failed"); -- cgit v1.2.3