Repository navigation
Conversation
read_pane_changes read the dimensions, cursor and sequence number, then took the terminal lock again for the viewport rows. A parser batch can scroll the screen between those reads; the rows then come from the old viewport while the push labels them as the live screen. A client scrolled back can show an old row at a stable index that now holds a different line, which is the top/bottom tear seen when a fast program scrolls under a reader. Re-read the geometry after the rows and report that later state. Rows from the old viewport are then correctly labelled as history; the new live rows are fetched by the client's next paint.
This was referenced Nov 10, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A candidate fix for the fast-output viewport tear discussed in #29 (the image-independent one, seen with a ThinkTerm scrollbar on a remote GUI).
read_pane_changesread the dimensions, cursor and sequence number, then took the terminal lock again for the viewport rows. The pane's parser runs on its own thread and holds the terminal lock per output batch, so it can scroll the screen between those reads. The rows then come from the old viewport, while the push reports the oldphysical_topas the live screen. A client scrolled back can render an old row at a stable index that now holds a different line, and the result is the top-frozen / bottom-following tear.This re-reads the geometry after the rows and reports that later state:
This is server-side only; the client does not need a rebuild.
Validation
cargo check -p wezterm-mux-serverclean.scrollback_lines=200, fast output, scroll up. The view stays coherent and the scrollbar tracks the trim.Part of #29. This is the fast-output viewport half; the history-loss half is #31.
Third-party material
None.
Contributor agreement
I agree to the ThinkTerm Contributor Agreement version 1.2 for this contribution, including the permission for a future MIT release and the patent license, and confirm I am authorized to make these grants.