From cf10f224886696538c2590cf8be4c9e0ae63c35f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 25 Jan 2020 14:52:06 +0100 Subject: [PATCH] Terminal: Start a new session before exec'ing the shell This will put everything running inside the terminal in the same SID. --- Applications/Terminal/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index 94b1c5903b2..d51ce1f2f30 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -69,8 +69,9 @@ static void run_command(int ptm_fd, String command) exit(1); } - // NOTE: It's okay if this fails. - (void)ioctl(0, TIOCNOTTY); + if (setsid() < 0) { + perror("setsid"); + } close(0); close(1);