From 91f9a3bbef5f275d0b8dc0a79dc4a4e0e04324ca Mon Sep 17 00:00:00 2001 From: unship Date: Thu, 30 Apr 2026 16:24:23 +0800 Subject: fix(sixel): accept tmux/screen TERM when tmux forwards Sixel (#14) `kitty-gfx--sixel-detect' currently gates on the outer TERM matching `xterm|vt[0-9]|foot|contour'. Once `tmux-ok' has confirmed tmux >= 3.4, tmux itself owns the Sixel rendering -- the DCS payload never reaches the outer terminal. At that point the outer TERM regex is irrelevant, but the canonical tmux assignment `tmux-256color' (and the legacy `screen-256color') still trip the check, and detection returns nil even when Sixel works fine. Accept `tmux*' and `screen*' TERMs when `tmux-ok' is true. Outside tmux the existing regex still rules, so no behavioural change for non-tmux setups. Repro before this patch: TERM=tmux-256color emacs -nw -Q -l kitty-graphics.el \ --eval '(setq kitty-gfx-debug t)' \ --eval '(kitty-graphics-mode 1)' => "Kitty graphics: terminal not supported" *kitty-gfx-debug*: sixel-detect: nil (TERM=tmux-256color ... tmux-ok=yes) --- kitty-graphics.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kitty-graphics.el b/kitty-graphics.el index d1514df..4879de6 100644 --- a/kitty-graphics.el +++ b/kitty-graphics.el @@ -650,6 +650,12 @@ Sixel because they drop the DCS payload." (supported (and term (or (not in-tmux) tmux-ok) (or (string-match-p "xterm\\|vt[0-9]\\|foot\\|contour" term) + ;; Once `tmux-ok' is true, tmux >= 3.4 itself + ;; renders Sixel, so the outer TERM regex is + ;; irrelevant -- accept the canonical + ;; tmux-* / screen-* TERMs that tmux assigns. + (and tmux-ok + (string-match-p "\\`\\(tmux\\|screen\\)\\b" term)) (member term-prog '("foot" "Konsole" "mintty" "mlterm" "contour" "WezTerm")) windows-terminal) -- cgit v1.3.1