aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-04-26 05:54:49 -0400
committerJesse Luehrs <doy@tozt.net>2016-04-26 05:54:49 -0400
commit2adc1256bafe38d350f83a3e7ccc4e6becf919a1 (patch)
tree242c724b27a4ee47ce80d034614192a3c8d23473
parent7f3b17bd263ac512e59354a33c43fd3b225ecc6d (diff)
downloadrunes-2adc1256bafe38d350f83a3e7ccc4e6becf919a1.tar.gz
runes-2adc1256bafe38d350f83a3e7ccc4e6becf919a1.zip
restore ability to parse escape sequences across packets
-rw-r--r--src/pty-unix.c7
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);
}