diff options
| author | cashmere <cashmere@autistici.org> | 2026-04-26 20:52:19 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-04-26 20:54:34 +0200 |
| commit | 9bf686f48e4dfcc64c4c9434a63989316f520dba (patch) | |
| tree | 1ac568beabfd8519922258ede5e97566a96a9dae /AGENTS.md | |
| parent | 4dfd1df3bc1f936ff7119beceae22b19e0c728d3 (diff) | |
| download | kitty-graphics-9bf686f48e4dfcc64c4c9434a63989316f520dba.tar.gz | |
feat(sixel): configurable encoder + per-invocation timeout
Sixel encoding was hard-coded to ImageMagick (`magick'/`convert') with no
timeout, so a malformed image or hung encoder could freeze Emacs and
users could not switch to libsixel's faster `img2sixel'.
- New customs: `kitty-gfx-sixel-encoder-program' (nil = auto-detect:
prefer img2sixel, then magick, then convert), `-encoder-args' (extra
args list), `-encoder-timeout' (float seconds, default 5.0, nil =
no timeout).
- New helper `kitty-gfx--sixel-resolve-encoder' returns
(KIND . ABS-PATH) where KIND is `img2sixel' or `imagemagick' so the
encode pipeline can build the right argv (`-w/-h <px>' vs
`-geometry WxH sixel:-').
- New helper `kitty-gfx--sixel-run-encoder' runs the encoder via
`make-process' with a separate stderr buffer and a `run-at-time'
watchdog that kills the process on timeout; failures and timeouts
are logged and surface as nil from `kitty-gfx--sixel-encode'
rather than freezing Emacs.
- Existing magick/convert path preserved and still chosen automatically
when img2sixel is absent.
- AGENTS.md: dependency note updated to mention img2sixel and the new
customs.
Inspired by and co-authored with @timfel's sixel-graphics.el fork
(https://github.com/timfel/sixel-graphics.el), which introduced the
configurable encoder + timeout pattern.
Refs #4.
Co-authored-by: Tim Felgentreff <timfel@users.noreply.github.com>
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -265,7 +265,10 @@ Key design differences from images: - **Required**: Emacs >= 27.1, a supported terminal (Kitty/WezTerm/Ghostty for Kitty backend; foot/Konsole/xterm/mlterm/mintty for Sixel) -- **Required for Sixel**: ImageMagick (`magick`/`convert`) for encoding +- **Required for Sixel**: a Sixel encoder on PATH -- `img2sixel` + (libsixel, recommended) or ImageMagick (`magick`/`convert`). + Override via `kitty-gfx-sixel-encoder-program'; bound by + `kitty-gfx-sixel-encoder-timeout' (default 5s). - **Optional for Kitty**: ImageMagick for non-PNG formats and pixel-accurate sizing - **Optional for typst preview**: `typst` CLI on PATH (used by `kitty-gfx-typst-preview`) |
