fixed bug: deadlock when resizing PTY window
This commit is contained in:
parent
78672521c4
commit
02266dfb0c
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue