From 77cc8c5612d0bc575818425ae4bac95e0d303074 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 27 Oct 2022 23:45:35 +0330 Subject: [PATCH] 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). --- Userland/Shell/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 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();