mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Userland: Install LibLine's signal handlers in the JS repl
This commit is contained in:
parent
f946d6ce79
commit
586aa3b1de
1 changed files with 10 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
|||
#include <LibJS/Runtime/Shape.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
#include <LibLine/Editor.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Vector<String> repl_statements;
|
||||
|
@ -396,6 +397,15 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
editor = make<Line::Editor>();
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue