drivers/pty: Close "slave" TTYs when the "master" is closed.
The old TTY driver did this, but it was not properly carried over into this new driver. Fixes the first part of #18488: the child bash process from the first session is properly closed, but the TTY state isn't reset and there can still be stale things left in its buffer, it appears.
This commit is contained in:
@@ -329,6 +329,12 @@ pty_close(void *_cookie)
|
||||
|
||||
MutexLocker globalLocker(gGlobalTTYLock);
|
||||
|
||||
if (cookie->tty->is_master) {
|
||||
// close all connected slave cookies first
|
||||
while (tty_cookie *slave = cookie->other_tty->cookies.Head())
|
||||
gTTYModule->tty_close_cookie(slave);
|
||||
}
|
||||
|
||||
gTTYModule->tty_close_cookie(cookie);
|
||||
|
||||
return B_OK;
|
||||
|
||||
Reference in New Issue
Block a user