Repository navigation
Conversation
tmux 3.4+ built with sixel renders sixel output from panes on its own, mapping it into the pane and keeping it in place across splits. Wrapping the image in passthrough instead sends it untouched to the outer terminal, where it is drawn at that terminal's cursor, not the pane-relative cursor position the backend just moved to: images land at the top-left of the whole window and stack on each other. When the attached client's termfeatures include sixel, the DCS sequence now goes straight to the pane; passthrough stays for tmux without native sixel.
Author
|
Closing this: I moved my setup to a terminal with the Kitty graphics protocol, so I can no longer test the sixel path and won't be maintaining this branch. The diagnosis in the description should still hold if someone wants to pick it up. |
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.
Problem
Since #366 the sixel backend always wraps images in tmux passthrough when running inside tmux. That helps tmux builds without sixel support, but when tmux renders sixel itself (tmux ≥ 3.4 built with
--enable-sixel, with the outer terminal advertising sixel), passthrough sends the image untouched to the outer terminal. The backend's cursor move (ESC [ y;x H) is not wrapped, so tmux applies it inside the pane, but the outer terminal draws the image at its own cursor. Every image ends up at the top-left of the whole terminal window, stacked on top of each other and over other panes.Seen with tmux 3.8 (
--enable-sixel) and a sixel-capable alacritty build;tmux display -p '#{client_termfeatures}'reportsbpaste,hyperlinks,focus,RGB,sixel,sync,title.Fix
utils/tmux.luareads the attached client's#{client_termfeatures}once at load and exposeshas_native_sixel.has_native_sixelis true. The DCS sequence then goes straight to the pane: tmux maps it into the pane at the pane-relative position the backend already moves to, clips it to the pane, and keeps it in place across splits.tmux without native sixel keeps the #366 behaviour unchanged.
Testing
has_native_sixelis true, so the image is written without the passthrough wrapper.is_tmuxandhas_native_sixelare both false and the code path is unchanged.