mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 01:04:38 +03:00
Userland: Install LibLine's signal handlers in the JS repl
This commit is contained in:
parent
f946d6ce79
commit
586aa3b1de
Notes:
sideshowbarker
2024-07-19 07:43:04 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/586aa3b1de4 Pull-request: https://github.com/SerenityOS/serenity/pull/1741
@ -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…
Reference in New Issue
Block a user