increased PTY client output buffer size

Corrected error checking for reading output from the client while at it.
This commit is contained in:
Christian Burger 2022-04-07 14:28:35 +02:00
parent 69d750b6ed
commit d01917c82d
2 changed files with 5 additions and 5 deletions

View file

@ -87,9 +87,9 @@ namespace krikkel::NCursesPtyWindow
void NCursesPtyWindow::readFromPtyClient() void NCursesPtyWindow::readFromPtyClient()
{ {
size_t bytesRead = read(fdPtyHost, clientOutputBuffer, CLIENT_OUTPUT_BUFFER_SIZE); size_t bytesRead = read(fdPtyHost, ptyClientOutputBuffer, PTY_CLIENT_OUTPUT_BUFFER_SIZE);
if(bytesRead) if(bytesRead != -1 && bytesRead != 0)
vterm_input_write(pseudoTerminal, clientOutputBuffer, bytesRead); vterm_input_write(pseudoTerminal, ptyClientOutputBuffer, bytesRead);
} }
VTermScreenCallbacks NCursesPtyWindow::screenCallbacks = VTermScreenCallbacks NCursesPtyWindow::screenCallbacks =

View file

@ -37,8 +37,8 @@ namespace krikkel::NCursesPtyWindow
VTermScreen *pseudoTerminalScreen; VTermScreen *pseudoTerminalScreen;
static VTermScreenCallbacks screenCallbacks; static VTermScreenCallbacks screenCallbacks;
/// @todo one line is at most 4096 chars long /// @todo one line is at most 4096 chars long
static const u_int CLIENT_OUTPUT_BUFFER_SIZE = 512; static const size_t PTY_CLIENT_OUTPUT_BUFFER_SIZE = 8192;
char clientOutputBuffer[CLIENT_OUTPUT_BUFFER_SIZE]; char ptyClientOutputBuffer[PTY_CLIENT_OUTPUT_BUFFER_SIZE];
uint16_t cursorX, cursorY; uint16_t cursorX, cursorY;
std::thread readPtyClientThread; std::thread readPtyClientThread;