summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-10-27 23:45:35 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-11-03 00:01:42 +0330
commit77cc8c5612d0bc575818425ae4bac95e0d303074 (patch)
tree2d093513e6902c36ba8dec7fbbbd6aa9ebd4a303 /Userland
parent922fa2e9d071c2d8a197d474fb4fdf22c9fcb148 (diff)
downloadserenity-77cc8c5612d0bc575818425ae4bac95e0d303074.zip
Shell: Re-block SIGTT{IN,OU} on start
This also shows up when trying to read from a 0x0 buffer as it has no PTY attached, avoid the mess by just blocking them (instead of ignoring them).
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Shell/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Shell/main.cpp b/Userland/Shell/main.cpp
index 7a68275018..57dc492b22 100644
--- a/Userland/Shell/main.cpp
+++ b/Userland/Shell/main.cpp
@@ -55,6 +55,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
s_shell->setup_signals();
+ sigset_t blocked;
+ sigemptyset(&blocked);
+ sigaddset(&blocked, SIGTTOU);
+ sigaddset(&blocked, SIGTTIN);
+ pthread_sigmask(SIG_BLOCK, &blocked, nullptr);
+
shell->termios = editor->termios();
shell->default_termios = editor->default_termios();