diff options
| -rw-r--r-- | AGENTS.md | 6 | ||||
| -rw-r--r-- | kitty-graphics.el | 19 |
2 files changed, 17 insertions, 8 deletions
@@ -32,7 +32,7 @@ emacs -Q -batch -l kitty-graphics.el -f kill-emacs No automated test framework. All testing is manual/interactive and requires a supported terminal (Kitty, WezTerm, Ghostty for Kitty backend; -foot, Konsole, xterm, mlterm, mintty for Sixel backend). +foot, Konsole, xterm, mlterm, mintty, Windows Terminal for Sixel backend). The `tests/` directory contains `test-kitty-gfx.org`, `test-image.png`, and `test-document.pdf` for manual testing -- use these rather than creating new test files. @@ -250,8 +250,8 @@ Key design differences from images: scrolling because tmux's cell buffer is not pixel-aware (upstream limit). Kitty graphics passthrough is still unimplemented -- tracked separately. - **Limitation**: Each mode needs explicit `:around` advice integration -- **Limitation**: GIF files are not supported (multi-frame conversion issues, - no animation support in terminal) +- **Limitation**: GIF files render only the first frame -- no animation + support in terminal (multi-frame conversion not implemented) - **Limitation**: Sixel is 256 colors (vs truecolor on Kitty), stateless (re-emits on scroll) - **Done**: LaTeX fragment preview in org-mode (#3) - **Done**: doc-view / pdf-view-mode integration (#4) diff --git a/kitty-graphics.el b/kitty-graphics.el index adfe6b7..430818a 100644 --- a/kitty-graphics.el +++ b/kitty-graphics.el @@ -642,17 +642,24 @@ Sixel because they drop the DCS payload." (in-tmux (getenv "TMUX")) (tmux-ver (and in-tmux (kitty-gfx--tmux-version))) (tmux-ok (kitty-gfx--tmux-sixel-supported-p)) + ;; Windows Terminal's TERM value is not stable enough to rely on + ;; alone, so accept its session markers when present. + (windows-terminal (or (getenv "WT_SESSION") + (getenv "WT_PROFILE_ID") + (getenv "WT_WINDOWID"))) (supported (and term (or (not in-tmux) tmux-ok) (or (string-match-p "xterm\\|vt[0-9]\\|foot\\|contour" term) (member term-prog '("foot" "Konsole" "mintty" "mlterm" - "contour" "WezTerm"))) + "contour" "WezTerm")) + windows-terminal) t))) (kitty-gfx--log - "sixel-detect: %s (TERM=%s TERM_PROGRAM=%s TMUX=%s tmux-ver=%s tmux-ok=%s)" + "sixel-detect: %s (TERM=%s TERM_PROGRAM=%s TMUX=%s tmux-ver=%s tmux-ok=%s WT=%s)" supported term term-prog (if in-tmux "yes" "no") (if tmux-ver (format "%d.%d" (car tmux-ver) (cadr tmux-ver)) "n/a") - (if tmux-ok "yes" "no")) + (if tmux-ok "yes" "no") + (if windows-terminal "yes" "no")) supported)) (defun kitty-gfx--sixel-cache-path (file cols rows) @@ -2289,11 +2296,13 @@ then let the refresh cycle re-emit the visible ones." (kitty-gfx--schedule-refresh))) (defun kitty-gfx--image-file-p (file) - "Return non-nil if FILE has an image extension." + "Return non-nil if FILE has an image extension. +GIF files are detected so they get routed through the image pipeline, +but only the first frame is rendered (no animation in terminal)." (let ((ext (file-name-extension file))) (and ext (member (downcase ext) '("png" "jpg" "jpeg" "bmp" "svg" - "webp" "tiff" "tif"))))) + "webp" "tiff" "tif" "gif"))))) (defun kitty-gfx--org-display-inline-images-tty (&optional _include-linked beg end) "Display inline images in org buffer via Kitty graphics. |
