summaryrefslogtreecommitdiff
path: root/Applications/Terminal/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-25 14:52:06 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-25 14:52:06 +0100
commitcf10f224886696538c2590cf8be4c9e0ae63c35f (patch)
tree6eedf2675bdf5b21f6990f9c43673bd4df46a7a6 /Applications/Terminal/main.cpp
parentc303f55b6069a6ab9fd468bf7b36bceaf4e5cd47 (diff)
downloadserenity-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/Terminal/main.cpp')
-rw-r--r--Applications/Terminal/main.cpp5
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);