diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index c96aaabc..8015b51d 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -944,6 +944,8 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) if (arg2 > ty->h) arg2 = ty->h; ty->state.scroll_y1 = arg - 1; ty->state.scroll_y2 = arg2; + if ((arg == 1) && (arg2 == ty->h)) + ty->state.scroll_y2 = 0; } } } diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index ee442131..428d7d87 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -90,11 +90,11 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear) } else { - cells = &(ty->screen[end_y * ty->w]); + cells = &(TERMPTY_SCREEN(ty, 0, end_y)); for (y = start_y; y < end_y; y++) { - cells = &(ty->screen[(y + 1) * ty->w]); - cells2 = &(ty->screen[y * ty->w]); + cells = &(TERMPTY_SCREEN(ty, 0, (y + 1))); + cells2 = &(TERMPTY_SCREEN(ty, 0, y)); termpty_cell_copy(ty, cells, cells2, ty->w); } if (clear)