Terminal: Start a new session before exec'ing the shell

This will put everything running inside the terminal in the same SID.
This commit is contained in:
Andreas Kling 2020-01-25 14:52:06 +01:00
parent c303f55b60
commit cf10f22488
Notes: sideshowbarker 2024-07-19 09:50:08 +09:00

View File

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