From b4e12512a0db4ce8823e2265faf020bb222875a7 Mon Sep 17 00:00:00 2001 From: cashmere Date: Sun, 26 Apr 2026 21:14:50 +0200 Subject: feat(tmux): unlock Sixel backend inside tmux >= 3.4 Sixel detection used to hard-disable the moment `$TMUX' was set. That guard predates tmux 3.4 (released 2024-02-13), which ships native Sixel rendering, so we were rejecting a working configuration. Drop the hard guard, gate on a parsed `tmux -V' >= 3.4, and let users opt out via a new custom var. - `kitty-gfx-tmux-allow-sixel' (default t). Set to nil if your tmux build lacks `--enable-sixel' or if you want to avoid the upstream scroll artifact (tmux's cell buffer is not pixel-aware, so images may persist after scrolling). - `kitty-gfx--tmux-version' parses `tmux -V' once per session and caches the result in `kitty-gfx--tmux-version-cache' (with an `unset' sentinel so we can distinguish "not probed" from "no tmux"). - `kitty-gfx--tmux-sixel-supported-p' centralises the (in-tmux + opt-in + version >= 3.4) check. - `kitty-gfx--sixel-detect' now uses the helper instead of `(not in-tmux)'. Debug log gained `tmux-ver=' and `tmux-ok='. - AGENTS.md / README.org / CHANGELOG.org: limitation reworded from "no tmux support" to a partial entry that explains exactly what works and what the remaining caveats are (Kitty APC passthrough is still unimplemented; scroll artifacts are upstream). - justfile: new `test-sixel-tmux' recipe wraps `test-sixel-image' in `tmux new-session' for one-command interactive verification, and the sibling `test-sixel-image' recipe was switched from a fragile shell conditional to an elisp `when' so passing an encoder argument no longer breaks the parse. Refs #2. --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index eb0ab62..6b95ac4 100644 --- a/README.org +++ b/README.org @@ -143,7 +143,7 @@ TIFF, BMP) are converted to PNG via ImageMagick before transmission. * Known Limitations -- No tmux support (neither Kitty passthrough nor Sixel) +- Partial tmux support: Sixel works inside tmux >= 3.4 (native sixel rendering, foot/Konsole/mintty/mlterm/WezTerm as outer terminal); set ~kitty-gfx-tmux-allow-sixel~ to ~nil~ to opt out. Images may stick to old positions after scrolling because tmux's cell buffer is not pixel-aware (upstream tmux limitation). Kitty graphics passthrough inside tmux is still unimplemented - Animated GIFs display only the first frame - Sixel is limited to 256 colors (vs truecolor on Kitty) and is stateless --- images are re-emitted on every scroll, which may be slower on large images - Without ImageMagick, only PNG files work on the Kitty backend; the Sixel backend requires ImageMagick unconditionally -- cgit v1.3.1