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
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); exit(1);
} }
// NOTE: It's okay if this fails. if (setsid() < 0) {
(void)ioctl(0, TIOCNOTTY); perror("setsid");
}
close(0); close(0);
close(1); close(1);