summaryrefslogtreecommitdiff
path: root/Libraries/LibLine/Editor.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-05-13 14:22:47 +0430
committerAndreas Kling <kling@serenityos.org>2020-05-13 15:07:44 +0200
commit98d25324fd8cb4c6710b1a57cd661bd68cae5ba9 (patch)
tree842e24757e1a0c28555e9e129bc31560e3457fb3 /Libraries/LibLine/Editor.cpp
parent2c45076e6861786f7000cbac812d6b3c63a9e3ca (diff)
downloadserenity-98d25324fd8cb4c6710b1a57cd661bd68cae5ba9.zip
LibLine: Add a hook to run when an interrupt is handled
We do not want to clog up signal handlers by putting possibly complex logic inside them, so allow the editor to handle that.
Diffstat (limited to 'Libraries/LibLine/Editor.cpp')
-rw-r--r--Libraries/LibLine/Editor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp
index a38fb2d5f0..b1ed9dcdb4 100644
--- a/Libraries/LibLine/Editor.cpp
+++ b/Libraries/LibLine/Editor.cpp
@@ -171,6 +171,10 @@ String Editor::get_line(const String& prompt)
m_buffer.clear();
m_cursor = 0;
+
+ if (on_interrupt_handled)
+ on_interrupt_handled();
+
m_refresh_needed = true;
continue;
}