diff options
author | Andreas Kling <kling@serenityos.org> | 2020-01-25 14:52:06 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-25 14:52:06 +0100 |
commit | cf10f224886696538c2590cf8be4c9e0ae63c35f (patch) | |
tree | 6eedf2675bdf5b21f6990f9c43673bd4df46a7a6 /Applications | |
parent | c303f55b6069a6ab9fd468bf7b36bceaf4e5cd47 (diff) | |
download | serenity-cf10f224886696538c2590cf8be4c9e0ae63c35f.zip |
Terminal: Start a new session before exec'ing the shell
This will put everything running inside the terminal in the same SID.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/Terminal/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index 94b1c5903b..d51ce1f2f3 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); |