From 34cfd0e55bc789d0482c0f1146e5813aadcd0c2f Mon Sep 17 00:00:00 2001 From: mintsuki Date: Tue, 28 Sep 2021 06:17:42 +0200 Subject: [PATCH] term: Fix bug related to scrolling regions --- stage23/lib/term.s2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stage23/lib/term.s2.c b/stage23/lib/term.s2.c index 0f5fdac9..7212a0f6 100644 --- a/stage23/lib/term.s2.c +++ b/stage23/lib/term.s2.c @@ -691,7 +691,7 @@ static void control_sequence_parse(uint8_t c) { break; case 'r': scroll_top_margin = 0; - scroll_bottom_margin = 0; + scroll_bottom_margin = term_rows; if (esc_values_i > 0) { scroll_top_margin = esc_values[0] - 1; } @@ -699,7 +699,7 @@ static void control_sequence_parse(uint8_t c) { scroll_bottom_margin = esc_values[1]; } if (scroll_top_margin >= term_rows - || scroll_bottom_margin >= term_rows + || scroll_bottom_margin > term_rows || scroll_top_margin >= (scroll_bottom_margin - 1)) { scroll_top_margin = 0; scroll_bottom_margin = term_rows;