From 5300921fabc1848431bb5b409c6947f59e1d050f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=BChling?= Date: Mon, 21 Feb 2011 23:54:07 +0100 Subject: [PATCH] gmenu2x: make console the foreground console before launching applications Emacs didn't like how it was launched before --- src/linkapp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/linkapp.cpp b/src/linkapp.cpp index e746755..6d8e060 100644 --- a/src/linkapp.cpp +++ b/src/linkapp.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -501,6 +502,10 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) { int pid = setsid(); ioctl(1, TIOCSCTTY, STDOUT_FILENO); + int pgid = tcgetpgrp(STDOUT_FILENO); + signal(SIGTTOU, SIG_IGN); + tcsetpgrp(STDOUT_FILENO, pgid); + execlp("/bin/sh","/bin/sh","-c",command.c_str(),NULL); //if execution continues then something went wrong and as we already called SDL_Quit we cannot continue //try relaunching gmenu2x