summaryrefslogtreecommitdiff
path: root/Shell/main.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-07-06 20:33:08 +0430
committerAndreas Kling <kling@serenityos.org>2020-07-06 22:39:32 +0200
commit5cdb0ef2e5bd741e82073069fe8a5ae1b29ec0ff (patch)
tree6f15c636308035ba282f0b4c9bf3adaf0a564ede /Shell/main.cpp
parent5fedf90bf9e19ea2d46e62af465992f8c8e37b30 (diff)
downloadserenity-5cdb0ef2e5bd741e82073069fe8a5ae1b29ec0ff.zip
Shell: Keep the TTY on the same pgroup to get tty signals
This allows the shell to be notified about SIGWINCH even when a child process is running in the foreground.
Diffstat (limited to 'Shell/main.cpp')
-rw-r--r--Shell/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Shell/main.cpp b/Shell/main.cpp
index 0939de5eb3..d08994c3a6 100644
--- a/Shell/main.cpp
+++ b/Shell/main.cpp
@@ -61,6 +61,8 @@ int main(int argc, char** argv)
Core::EventLoop loop;
signal(SIGINT, [](int) {
+ if (!s_shell->is_accepting_signals())
+ return;
editor->interrupted();
});
@@ -68,7 +70,12 @@ int main(int argc, char** argv)
editor->resized();
});
+ signal(SIGTTIN, [](int) {});
+ signal(SIGTTOU, [](int) {});
+
signal(SIGHUP, [](int) {
+ if (!s_shell->is_accepting_signals())
+ return;
s_shell->save_history();
});