diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pty-unix.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pty-unix.c b/src/pty-unix.c index 21e261b..242280f 100644 --- a/src/pty-unix.c +++ b/src/pty-unix.c @@ -152,8 +152,11 @@ static void runes_pty_backend_got_data(uv_work_t *req, int status) UNUSED(status); if (pty->readlen > 0) { - vt100_screen_process_string( - &t->scr, pty->readbuf, pty->readlen + pty->remaininglen); + int to_process = pty->readlen + pty->remaininglen; + int processed = vt100_screen_process_string( + &t->scr, pty->readbuf, to_process); + pty->remaininglen = to_process - processed; + memmove(pty->readbuf, pty->readbuf + processed, pty->remaininglen); uv_queue_work( t->loop, req, runes_pty_backend_read, runes_pty_backend_got_data); } |