diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index f8f34d9f..2c6889b1 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -946,6 +946,7 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) { DBG("2 regions args: %i %i", arg, arg2); if (arg >= ty->h) arg = ty->h - 1; + if (arg == 0) arg = 1; if (arg2 > ty->h) arg2 = ty->h; ty->state.scroll_y1 = arg - 1; ty->state.scroll_y2 = arg2; diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index 05ec5f1f..ed3c6a87 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -92,7 +92,7 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear) else { cells = &(TERMPTY_SCREEN(ty, 0, end_y)); - for (y = start_y; y < end_y; y++) + for (y = start_y; y < end_y - 1; y++) { cells = &(TERMPTY_SCREEN(ty, 0, (y + 1))); cells2 = &(TERMPTY_SCREEN(ty, 0, y));