mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 20:25:54 +02:00
gmenu2x: make console the foreground console before launching applications
Emacs didn't like how it was launched before
This commit is contained in:
parent
e9c58f5114
commit
5300921fab
@ -20,6 +20,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <fstream>
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user