added code that makes sure apps executed by epist don't die when epist is killed.
This commit is contained in:
parent
d4b6232f6b
commit
499b1620c1
1 changed files with 6 additions and 0 deletions
|
@ -568,6 +568,12 @@ void screen::updateActiveWindow() {
|
||||||
void screen::execCommand(const string &cmd) const {
|
void screen::execCommand(const string &cmd) const {
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
if ((pid = fork()) == 0) {
|
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
|
// make the command run on the correct screen
|
||||||
if (putenv(const_cast<char*>(_info->displayString().c_str()))) {
|
if (putenv(const_cast<char*>(_info->displayString().c_str()))) {
|
||||||
cout << "warning: couldn't set environment variable 'DISPLAY'\n";
|
cout << "warning: couldn't set environment variable 'DISPLAY'\n";
|
||||||
|
|
Loading…
Reference in a new issue