* The PtyReader thread now just exits when there is no more left to be read.
* setpgid() when spawning the shell was superfluous, as we're already the session leader. * Added a comment to TermView::NotifyQuit() about why sending B_QUIT_REQUESTED to the window isn't such a good idea when you have more than one use for it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21794 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f328fdc455
commit
69f6c88d58
@ -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;
|
||||
|
@ -5,7 +5,6 @@
|
||||
* Authors:
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
*/
|
||||
|
||||
#ifndef __SMARTTABVIEW_H
|
||||
#define __SMARTTABVIEW_H
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user