fixed bug: deadlock when resizing PTY window

This commit is contained in:
Christian Burger 2022-04-29 16:36:07 +02:00
parent 78672521c4
commit 02266dfb0c

View file

@ -258,17 +258,20 @@ namespace krikkel::NCursesPtyWindow
/// resizing?
int PtyWindow::wresize(int rows, int cols)
{
lock_guard nCursesLock(*writeToNCursesMutex);
lock_guard writeLock(writeToPseudoTerminalMutex);
winsize windowSize =
{
.ws_row = narrow<unsigned short>(rows)
, .ws_col = narrow<unsigned short>(cols)
};
ioctl(fdPtyHost, TIOCSWINSZ, &windowSize);
vterm_set_size(pseudoTerminal, rows, cols);
return NCursesWindow::wresize(rows, cols);
lock_guard writeLock(writeToPseudoTerminalMutex);
winsize windowSize =
{
.ws_row = narrow<unsigned short>(rows)
, .ws_col = narrow<unsigned short>(cols)
};
ioctl(fdPtyHost, TIOCSWINSZ, &windowSize);
vterm_set_size(pseudoTerminal, rows, cols);
}
{
lock_guard nCursesLock(*writeToNCursesMutex);
return NCursesWindow::wresize(rows, cols);
}
}
int PtyWindow::staticHandlerDamage(VTermRect rect, void *user)