From 2adc1256bafe38d350f83a3e7ccc4e6becf919a1 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 26 Apr 2016 05:54:49 -0400 Subject: restore ability to parse escape sequences across packets --- src/pty-unix.c | 7 +++++-- 1 file 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); } -- cgit v1.2.3-54-g00ecf