diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index 97906875cf..6367ef2524 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -345,7 +345,6 @@ Shell::_Spawn(int row, int col, const char *command, const char *encoding) return B_ERROR; } - handshake_t handshake; if (fProcessID == 0) { @@ -489,20 +488,8 @@ Shell::_Spawn(int row, int col, const char *command, const char *encoding) ioctl(0, TIOCSWINSZ, &ws); - /* - * Set process group ID to process, and Terminal Process group ID - * to this process group ID (equal process ID). - */ - - pid_t processGroup = getpid(); - if (setpgid(processGroup, processGroup) < 0) { - handshake.status = PTY_NG; - snprintf(handshake.msg, sizeof(handshake.msg), - "can't set process group id."); - send_handshake_message(terminalThread, handshake); - exit(1); - } - tcsetpgrp(0, processGroup); + tcsetpgrp(0, getpgrp()); + // set this process group ID as the controlling terminal /* pty open and set termios successful. */ handshake.status = PTY_OK; diff --git a/src/apps/terminal/SmartTabView.h b/src/apps/terminal/SmartTabView.h index 974f06b615..150ad55d29 100644 --- a/src/apps/terminal/SmartTabView.h +++ b/src/apps/terminal/SmartTabView.h @@ -5,7 +5,6 @@ * Authors: * Stefano Ceccherini (burton666@libero.it) */ - #ifndef __SMARTTABVIEW_H #define __SMARTTABVIEW_H diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index a3518849e1..a844436468 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -258,10 +258,7 @@ TermParse::PtyReader() int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition)); if (nread <= 0) { fView->NotifyQuit(errno); - // on the next iteration, fQuitting will probably be true, - // or the semaphore acquisition will fail, so this thread will - // be killed anyway. - continue; + return B_OK; } // Copy read string to PtyBuffer. diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 11cdcc1b45..54b76cc7e1 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -2454,7 +2454,8 @@ void TermView::NotifyQuit(int32 reason) { // TODO: If we are a replicant, we can't just quit the BWindow, no?. - Window()->PostMessage(B_QUIT_REQUESTED); + // Exactly, and the same is true for tabs! + Window()->PostMessage(B_QUIT_REQUESTED); }