mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:37:35 +00:00
LibVT: Don't assert if ioctl(TIOCSWINSZ) fails
This ioctl can fail if we're resizing the terminal right when the shell inside it has exited. Instead of throwing up a crash reporter, whine a little bit in the debug log and exit cleanly moments later.
This commit is contained in:
parent
e855aac1f5
commit
13e8a2a671
1 changed files with 4 additions and 2 deletions
|
@ -975,8 +975,10 @@ void TerminalWidget::terminal_did_resize(u16 columns, u16 rows)
|
|||
ws.ws_row = rows;
|
||||
ws.ws_col = columns;
|
||||
if (m_ptm_fd != -1) {
|
||||
int rc = ioctl(m_ptm_fd, TIOCSWINSZ, &ws);
|
||||
ASSERT(rc == 0);
|
||||
if (ioctl(m_ptm_fd, TIOCSWINSZ, &ws) < 0) {
|
||||
// This can happen if we resize just as the shell exits.
|
||||
dbgln("Notifying the pseudo-terminal about a size change failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue