summaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
authorcashmeredev <cashmere@autistici.org>2026-04-26 21:34:55 +0200
committerGitHub <noreply@github.com>2026-04-26 21:34:55 +0200
commit504635cee14ce19be1dd3a2d8d57c6b5a20fe44f (patch)
tree274cb1d5131a4a0c815cb3adb6b58bc65a14a04c /justfile
parentbcf54dda11f333b217443747f865c803dd7e489d (diff)
parent8d96906eda19ac94613323deac3c039f88d466e0 (diff)
downloadkitty-graphics-504635cee14ce19be1dd3a2d8d57c6b5a20fe44f.tar.gz
Merge pull request #11 from cashmeredev/feat/tmux-sixel
feat(tmux): unlock Sixel backend inside tmux >= 3.4
Diffstat (limited to 'justfile')
-rw-r--r--justfile25
1 files changed, 24 insertions, 1 deletions
diff --git a/justfile b/justfile
index 22fe756..306290e 100644
--- a/justfile
+++ b/justfile
@@ -141,10 +141,33 @@ test-sixel-image encoder="":
@echo ">> Run inside foot, Konsole, mintty, mlterm, or WezTerm."
TERM={{TERM_}} {{EMACS}} -nw -Q -l {{SRC}} \
--eval "(setq kitty-gfx-debug t kitty-gfx-preferred-protocol 'sixel)" \
- $(if [ -n "{{encoder}}" ]; then echo "--eval (setq\\ kitty-gfx-sixel-encoder-program\\ \"{{encoder}}\")"; fi) \
+ --eval '(when (> (length "{{encoder}}") 0) (setq kitty-gfx-sixel-encoder-program "{{encoder}}"))' \
--eval "(kitty-graphics-mode 1)" \
tests/test-image.png
+# Open test-image.png inside tmux with sixel backend forced.
+# Outer terminal must be sixel-capable (foot, Konsole, mintty, mlterm, WezTerm).
+# Requires tmux >= 3.4 built with --enable-sixel.
+# When already inside tmux, runs emacs directly (no nesting).
+test-sixel-tmux encoder="":
+ #!/usr/bin/env bash
+ set -eu
+ if [ -n "${TMUX:-}" ]; then
+ echo ">> Already inside tmux -- running emacs directly in this pane."
+ exec env TERM={{TERM_}} {{EMACS}} -nw -Q -l {{SRC}} \
+ --eval '(setq kitty-gfx-debug t kitty-gfx-preferred-protocol (quote sixel))' \
+ --eval '(when (> (length "{{encoder}}") 0) (setq kitty-gfx-sixel-encoder-program "{{encoder}}"))' \
+ --eval '(kitty-graphics-mode 1)' \
+ tests/test-image.png
+ else
+ echo ">> Outer terminal must be sixel-capable; spawning fresh tmux session."
+ exec tmux new-session -As kgfx-sixel-test \
+ "TERM={{TERM_}} {{EMACS}} -nw -Q -l {{SRC}} \
+ --eval '(setq kitty-gfx-debug t kitty-gfx-preferred-protocol (quote sixel))' \
+ --eval '(when (> (length \"{{encoder}}\") 0) (setq kitty-gfx-sixel-encoder-program \"{{encoder}}\"))' \
+ --eval '(kitty-graphics-mode 1)' tests/test-image.png"
+ fi
+
# --- Logs -------------------------------------------------------------------
# Tail the kitty-gfx debug log (set kitty-gfx-debug to t to populate)