1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:17:42 +00:00

LibLinEdit + Shell: handle signals

This allows the LineEditor to get notified about signals, since we
cannot set signal handlers in a clean way within the LineEditor
instance.
This commit is contained in:
AnotherTest 2020-03-30 21:55:09 +04:30 committed by Andreas Kling
parent 21c4c67119
commit 5062a7d4cd
3 changed files with 12 additions and 12 deletions

View file

@ -1154,14 +1154,16 @@ int main(int argc, char** argv)
signal(SIGINT, [](int) {
g.was_interrupted = true;
});
signal(SIGHUP, [](int) {
save_history();
editor.interrupted();
});
signal(SIGWINCH, [](int) {
g.was_resized = true;
editor.resized();
});
signal(SIGHUP, [](int) {
save_history();
});
int rc = gethostname(g.hostname, sizeof(g.hostname));