From aa4b17542d009feaab1a2ebe3f7a4a464d2fab61 Mon Sep 17 00:00:00 2001 From: Sean Estabrooks Date: Mon, 23 Sep 2024 19:39:32 -0400 Subject: [PATCH] Fix alternate-screen scrolling The alternate-screen mode disables scrollback. This means that we delete lines off of the top of the screen when scrolling, without saving them. But we weren't keeping a count of those lines, which meant a stable index was lost; leaving the mux-server unable to properly track scrolling. Now we keep track of the stable_row_index_offset, even when there is no scrollback. This turns out to be the exact same logic as when scrollback is enabled, but after "erase_scrollback" has been called. In both cases, stable_row_index_offset is used to count the number of scrollback-lines, that don't exist in the buffer. As per issue #6166 --- term/src/screen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/term/src/screen.rs b/term/src/screen.rs index 10a06077abc..729564ee55f 100644 --- a/term/src/screen.rs +++ b/term/src/screen.rs @@ -724,7 +724,7 @@ impl Screen { self.lines.remove(remove_idx); } - if remove_idx == 0 && self.allow_scrollback { + if remove_idx == 0 { self.stable_row_index_offset += lines_removed; }