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:
parent
21c4c67119
commit
5062a7d4cd
3 changed files with 12 additions and 12 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue