From 586aa3b1de45f0e437b8c316ade8475cd2a31046 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 11 Apr 2020 13:39:10 +0430 Subject: [PATCH] Userland: Install LibLine's signal handlers in the JS repl --- Userland/js.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Userland/js.cpp b/Userland/js.cpp index 8f613fbfa6..21b9f87818 100644 --- a/Userland/js.cpp +++ b/Userland/js.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include Vector repl_statements; @@ -396,6 +397,15 @@ int main(int argc, char** argv) } editor = make(); + + signal(SIGINT, [](int) { + editor->interrupted(); + }); + + signal(SIGWINCH, [](int) { + editor->resized(); + }); + editor->initialize(); editor->on_display_refresh = [syntax_highlight](Line::Editor& editor) { auto stylize = [&](Line::Span span, Line::Style styles) {