From 42114c57847015ed4a41216584c580e3d4a010f0 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Mon, 25 May 2020 23:43:43 +0430 Subject: [PATCH] Shell: Refuse to be suspended with ^Z Suspending the shell while interacting with it is pretty weird, so let's just disallow this behaviour. --- Shell/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Shell/main.cpp b/Shell/main.cpp index 06ebebfe78..f9278fa020 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -104,6 +104,9 @@ int main(int argc, char** argv) } }); + // Ignore SIGTSTP as the shell should not be suspended with ^Z. + signal(SIGTSTP, [](auto) {}); + if (argc > 2 && !strcmp(argv[1], "-c")) { dbgprintf("sh -c '%s'\n", argv[2]); shell->run_command(argv[2]);