diff --git a/NCursesPtyWindow.cpp b/NCursesPtyWindow.cpp index 510febe..24e02bc 100644 --- a/NCursesPtyWindow.cpp +++ b/NCursesPtyWindow.cpp @@ -87,9 +87,9 @@ namespace krikkel::NCursesPtyWindow void NCursesPtyWindow::readFromPtyClient() { - size_t bytesRead = read(fdPtyHost, clientOutputBuffer, CLIENT_OUTPUT_BUFFER_SIZE); - if(bytesRead) - vterm_input_write(pseudoTerminal, clientOutputBuffer, bytesRead); + size_t bytesRead = read(fdPtyHost, ptyClientOutputBuffer, PTY_CLIENT_OUTPUT_BUFFER_SIZE); + if(bytesRead != -1 && bytesRead != 0) + vterm_input_write(pseudoTerminal, ptyClientOutputBuffer, bytesRead); } VTermScreenCallbacks NCursesPtyWindow::screenCallbacks = diff --git a/NCursesPtyWindow.hpp b/NCursesPtyWindow.hpp index 823bb26..13e6df8 100644 --- a/NCursesPtyWindow.hpp +++ b/NCursesPtyWindow.hpp @@ -37,8 +37,8 @@ namespace krikkel::NCursesPtyWindow VTermScreen *pseudoTerminalScreen; static VTermScreenCallbacks screenCallbacks; /// @todo one line is at most 4096 chars long - static const u_int CLIENT_OUTPUT_BUFFER_SIZE = 512; - char clientOutputBuffer[CLIENT_OUTPUT_BUFFER_SIZE]; + static const size_t PTY_CLIENT_OUTPUT_BUFFER_SIZE = 8192; + char ptyClientOutputBuffer[PTY_CLIENT_OUTPUT_BUFFER_SIZE]; uint16_t cursorX, cursorY; std::thread readPtyClientThread;