Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alternate-screen scrolling #6186

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix alternate-screen scrolling #6186

wants to merge 2 commits into from

Conversation

loops
Copy link
Contributor

@loops loops commented Sep 24, 2024

Hi Wez,

Did the test case you requested, but it didn't demonstrate the problem. So
after staring at it a bit more, found this one-liner. Hope it's okay.

This doesn't demonstrate a problem, since the screen
contents are correct.  The actual problem is that
a count of the number of lines discarded from the
top of the screen, wasn't being tracked.
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 wez#6166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant