Reuse the paintings of rows that moved, though the terminal counts them as new

A full-screen program scrolls by moving lines within the screen: a newline in a scroll region, or inserting or deleting lines. libghostty gives the moved rows new IDs, so every row on screen was painted and uploaded to the GPU again, a slow frame each time a chat like Claude Code's scrolled. A row that changed is now read into a row of its own, and before painting, each row to paint takes the painting of a row no longer shown with the same cells, if there is one, found by a hash of the cells. For a full 1080p pane, a frame of a scroll region moving a line, until the GPU is done, goes from 4.0ms to 2.0ms; what's left is reading the cells. TestRowsRedrawn gains steps that scroll regions and insert and delete lines, and fails if rows are matched by their hash alone.


Author Daniel Patterson Date Commit Parent ef039b06 Change ID
+153 -18
3 changed files
+153 -18
3 changed files