* 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:
@@ -345,7 +345,6 @@ Shell::_Spawn(int row, int col, const char *command, const char *encoding)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
handshake_t handshake;
|
handshake_t handshake;
|
||||||
|
|
||||||
if (fProcessID == 0) {
|
if (fProcessID == 0) {
|
||||||
@@ -489,20 +488,8 @@ Shell::_Spawn(int row, int col, const char *command, const char *encoding)
|
|||||||
|
|
||||||
ioctl(0, TIOCSWINSZ, &ws);
|
ioctl(0, TIOCSWINSZ, &ws);
|
||||||
|
|
||||||
/*
|
tcsetpgrp(0, getpgrp());
|
||||||
* Set process group ID to process, and Terminal Process group ID
|
// set this process group ID as the controlling terminal
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* pty open and set termios successful. */
|
/* pty open and set termios successful. */
|
||||||
handshake.status = PTY_OK;
|
handshake.status = PTY_OK;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
* Authors:
|
* Authors:
|
||||||
* Stefano Ceccherini ([email protected])
|
* Stefano Ceccherini ([email protected])
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SMARTTABVIEW_H
|
#ifndef __SMARTTABVIEW_H
|
||||||
#define __SMARTTABVIEW_H
|
#define __SMARTTABVIEW_H
|
||||||
|
|
||||||
|
|||||||
@@ -258,10 +258,7 @@ TermParse::PtyReader()
|
|||||||
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
|
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
|
||||||
if (nread <= 0) {
|
if (nread <= 0) {
|
||||||
fView->NotifyQuit(errno);
|
fView->NotifyQuit(errno);
|
||||||
// on the next iteration, fQuitting will probably be true,
|
return B_OK;
|
||||||
// or the semaphore acquisition will fail, so this thread will
|
|
||||||
// be killed anyway.
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy read string to PtyBuffer.
|
// Copy read string to PtyBuffer.
|
||||||
|
|||||||
@@ -2454,7 +2454,8 @@ void
|
|||||||
TermView::NotifyQuit(int32 reason)
|
TermView::NotifyQuit(int32 reason)
|
||||||
{
|
{
|
||||||
// TODO: If we are a replicant, we can't just quit the BWindow, no?.
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user