diff options
| author | unship <liyananfamily@gmail.com> | 2026-04-30 16:24:23 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-30 10:24:23 +0200 |
| commit | 91f9a3bbef5f275d0b8dc0a79dc4a4e0e04324ca (patch) | |
| tree | 5c27a65b323f58b9dbea2f7d72fc74c8b2800d2e | |
| parent | 2a9c024f9e3c9fbd0835fe0bd07dc1ebd2107a6e (diff) | |
| download | kitty-graphics-91f9a3bbef5f275d0b8dc0a79dc4a4e0e04324ca.tar.gz | |
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)
| -rw-r--r-- | kitty-graphics.el | 6 |
1 files changed, 6 insertions, 0 deletions
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) |
