Conpty: Additional ScrollFrame optimizations #7261

Open
opened 2026-01-31 00:59:24 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (Apr 3, 2020).

In #5181, I changed XtermEngine::ScrollFrame to actually work.

Part of the trickiness with that function is that we need to make sure to emit newlines to scroll new lines into the terminal, but we also need to preserve linewrap state for lines that might have been split across paints.

  • If only the bottom line is invalid, don't manually emit a newline.
    • We need to manually emit newlines to make sure there's space at the bottom of the terminal's buffer. However, if only the bottom line is invalid, then we're going to emit a newline to get to the next line of the buffer anyways. We only need the newlines if there's other invalid regions in the buffer, because those regions will get painted (to the wrong place) before we newline to the new bottom line.
    • This includes "don't mark the last cell as invalid" for a wrapped line
  • Also discussed at this time: use a bitset to track which lines are new instead of the single _newBottomLine member. This is probably more correct for cases where multiple lines are getting scrolled in at a time.
  • Alt+ Enter rendering error (#7019)
Originally created by @zadjii-msft on GitHub (Apr 3, 2020). In #5181, I changed `XtermEngine::ScrollFrame` to actually work. Part of the trickiness with that function is that we need to make sure to emit newlines to scroll new lines into the terminal, but we also need to preserve linewrap state for lines that might have been split across paints. * [ ] If only the bottom line is invalid, don't manually emit a newline. - We need to manually emit newlines to make sure there's space at the bottom of the terminal's buffer. However, if only the bottom line is invalid, then we're going to emit a newline to get to the next line of the buffer anyways. We only need the newlines if there's other invalid regions in the buffer, because those regions will get painted (to the wrong place) _before_ we newline to the new bottom line. - This includes "don't mark the last cell as invalid" for a wrapped line * [ ] Also discussed at this time: use a `bitset` to track which lines are new instead of the single `_newBottomLine` member. This is probably _more_ correct for cases where multiple lines are getting scrolled in at a time. * [x] #7019
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7261