1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00

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).
This commit is contained in:
Ali Mohammad Pur 2022-10-27 23:45:35 +03:30 committed by Ali Mohammad Pur
parent 922fa2e9d0
commit 77cc8c5612

View file

@ -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();