mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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
Notes:
sideshowbarker
2024-07-18 23:58:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/13e8a2a671d
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…
Reference in a new issue