summaryrefslogtreecommitdiff
path: root/Libraries/LibLine
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-04-22 14:18:17 +0430
committerAndreas Kling <kling@serenityos.org>2020-04-22 12:12:41 +0200
commit1a7af4d677d1659e7fb95e7704ff92f9bdc11a7f (patch)
tree04eab531936b98717a8b49e87d6003672d7868f1 /Libraries/LibLine
parent0d47ad7efea4c82d9ffeed3dba16ddb448b77a17 (diff)
downloadserenity-1a7af4d677d1659e7fb95e7704ff92f9bdc11a7f.zip
LibLine: Do not ignore ^C and do not finish() after interrupt
Diffstat (limited to 'Libraries/LibLine')
-rw-r--r--Libraries/LibLine/Editor.cpp16
1 files changed, 9 insertions, 7 deletions
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");