mirror of
https://github.com/tmux/tmux.git
synced 2026-09-21 20:37:42 +00:00
There is no way to query a terminal for whether it moves SIXEL image content along with the rest of a scrolling region, so tmux always redrew the image after every scroll rather than assuming the terminal did it for free the way Kitty placements already are (IMAGE_BACKEND_ SCROLLS). Add a server option, default on, that lets sixel opt into the same trust; image_backend_flags() now ORs SCROLLS in for the sixel backend when it's set. Splitting SCROLLS out surfaced a second, unrelated property the two image_backend_flags() checks had been conflating: whether a backend also respects its own cell boundaries rather than bleeding pixels onto neighbouring rows, which is what the "redraw a pane's border-status after a GRAPHICAL-only redraw" guard in screen-redraw.c was actually testing for. Give that its own IMAGE_BACKEND_CLIPPED flag (kitty only) so turning sixel-region-scrolling on doesn't also disable that unrelated border-status protection. Includes a regress test proving the scroll-skip decision is wired correctly with the option on and off, and a manual visual test (tools/sixel-scroll-region-test.sh + tools/sixel-ruler.six, a numbered colour-band SIXEL image) for checking real terminals by eye, since nothing here can verify what a given terminal actually renders. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>