From d07e7d2aab42105ead451c5381ddc0b52994b6b1 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 23 Aug 2012 11:39:46 +0200 Subject: [PATCH] Fix running applications in non-xterm terminals Setting Tools/Options/Environment/General/Terminal to one of the following works now as expected. 1. xterm -e 2. aterm -e 3. rxvt -e 4. urxvt -e 5. xfce4-terminal -x 6. konsole --nofork -e 7. gnome-terminal -x Without the '--nofork' option for konsole, from creator's pov, the terminal emulator will finish immediately and therefore creator closes the local socket. As a result of this, the user is presented with sth. like this (from the stub): Cannot connect creator comm socket /tmp/qt_temp.A13523/stub-socket: No such file or directory. Task-Number: QTCREATORBUG-1633 Change-Id: I732e20d34aebdc1591355e0c4e78c907f439924c Reviewed-by: Oswald Buddenhagen --- src/libs/utils/process_stub_unix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libs/utils/process_stub_unix.c b/src/libs/utils/process_stub_unix.c index 75096f230d9..2c4263a99e8 100644 --- a/src/libs/utils/process_stub_unix.c +++ b/src/libs/utils/process_stub_unix.c @@ -154,6 +154,12 @@ int main(int argc, char *argv[]) env[count] = 0; } + + /* Ignore SIGTTOU. Without this, calling tcsetpgrp() from a background + * process group (in which we will be, once as child and once as parent) + * generates the mentioned signal and stops the concerned process. */ + signal(SIGTTOU, SIG_IGN); + /* Create execution result notification pipe. */ if (pipe(chldPipe)) { perror("Cannot create status pipe");