bakkeby / st-flexipatch

An st build with preprocessor directives to decide which patches to include during build time
MIT License
353 stars 108 forks source link

sixel: fix scrolling issues inside tmux #114

Closed veltza closed 7 months ago

veltza commented 7 months ago

tmux is using the scrolling region and sequence to clear the screen below the shell prompt. This peculiar behavior caused the tscrollup() function to be called, which always scrolled the images regardless of whether they were inside the region or not. So the images moved out of place whenever the bottom of the screen was cleared. This fix checks that the images are inside the region before scrolling them.

veltza commented 7 months ago

I still have at least one more PR coming up. It has to do with resizing. I can't port it directly from st-sx, so I have to rewrite it.

bakkeby commented 7 months ago

I noticed that with st-sx + tmux images also disappear when the window is resized.

I also tried xterm enabling sixel support like this:

xterm -xrm "XTerm*decTerminalID: vt340" -xrm "XTerm*numColorRegisters: 256"

and sixel images also disappear there when you resize the terminal (but only when tmux is used), so I suspect that this may be an issue with tmux?

veltza commented 7 months ago

The resizing issue I'm working on has nothing to do with tmux. I will submit the PR tomorrow.

And speaking of tmux, it has very unreliable sixel support. Sixels may disappear when you resize or when you switch from the alternate screen to the main screen. It has nothing to do with the terminal.

bakkeby commented 7 months ago

Ah ok, so it is a different issue.