summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarius Nita <marius@cs.pdx.edu>2002-09-12 09:51:53 +0000
committerMarius Nita <marius@cs.pdx.edu>2002-09-12 09:51:53 +0000
commit499b1620c15830f06ae7aaf24183e4407e21770e (patch)
tree98ebeb72e58acb61bd57ddcfd4ff7e50f2e91503 /util
parentd4b6232f6b7ad0f66c3e7cad8487e42100effe20 (diff)
added code that makes sure apps executed by epist don't die when epist is killed.
Diffstat (limited to 'util')
-rw-r--r--util/epist/screen.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 0220a949..5711d551 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -568,6 +568,12 @@ void screen::updateActiveWindow() {
void screen::execCommand(const string &cmd) const {
pid_t pid;
if ((pid = fork()) == 0) {
+ // disconnect the child from epist's session and the tty
+ if (setsid() == -1) {
+ cout << "warning: could not start a new process group\n";
+ perror("setsid");
+ }
+
// make the command run on the correct screen
if (putenv(const_cast<char*>(_info->displayString().c_str()))) {
cout << "warning: couldn't set environment variable 'DISPLAY'\n";