<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kitty-graphics, branch master</title>
<subtitle></subtitle>
<id>http://git.cashmere.rs/kitty-graphics/atom/?h=master</id>
<link rel='self' href='http://git.cashmere.rs/kitty-graphics/atom/?h=master'/>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/'/>
<updated>2026-04-30T08:41:50Z</updated>
<entry>
<title>Revert "Merge pull request #16 from timfel/master"</title>
<updated>2026-04-30T08:41:50Z</updated>
<author>
<name>cashmere</name>
<email>cashmere@autistici.org</email>
</author>
<published>2026-04-30T08:41:50Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=3a198ba6586562cbae33130de226ae5b73f3958c'/>
<id>urn:sha1:3a198ba6586562cbae33130de226ae5b73f3958c</id>
<content type='text'>
This reverts commit 308fc78775058d583449b6ffcdc227cf7f1280af, reversing
changes made to 632b33b6ecbc3e2a7c8277effcac9b2de0fff5a9.
</content>
</entry>
<entry>
<title>Merge pull request #16 from timfel/master</title>
<updated>2026-04-30T08:28:40Z</updated>
<author>
<name>cashmeredev</name>
<email>cashmeresocial@paranoici.org</email>
</author>
<published>2026-04-30T08:28:40Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=308fc78775058d583449b6ffcdc227cf7f1280af'/>
<id>urn:sha1:308fc78775058d583449b6ffcdc227cf7f1280af</id>
<content type='text'>
Fix multiple issues with Sixel</content>
</entry>
<entry>
<title>fix(detect): read terminal env from frame for emacs --daemon (#15)</title>
<updated>2026-04-30T08:25:21Z</updated>
<author>
<name>unship</name>
<email>liyananfamily@gmail.com</email>
</author>
<published>2026-04-30T08:25:21Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=632b33b6ecbc3e2a7c8277effcac9b2de0fff5a9'/>
<id>urn:sha1:632b33b6ecbc3e2a7c8277effcac9b2de0fff5a9</id>
<content type='text'>
`kitty-gfx--kitty-detect' and `kitty-gfx--sixel-detect' read TERM,
TERM_PROGRAM, TMUX, KITTY_PID, and the WT_* markers via
`(getenv VAR)' -- the process-level lookup.  Under
`emacs --daemon' / `emacsclient -t', the daemon process inherits
the launcher's env (often `TERM=dumb' from a systemd unit, no
TMUX, no TERM_PROGRAM); the *attached client* env lives on the
new frame's `environment' parameter.  As a result, every detect
call sees daemon env and reports "terminal not supported" even
when the client is attached from a fully sixel-/kitty-capable
terminal inside tmux.

Note `(getenv VAR FRAME)' only consults the frame env (no
process fallback), and `(getenv VAR)' only consults the process
env first (then the *selected* frame's env).  Neither alone gives
the desired prefer-frame-then-process semantics.  Add a small
helper `kitty-gfx--frame-getenv' that does, and route both detect
functions plus `kitty-gfx--tmux-sixel-supported-p' through it.

For TERM specifically also consult the frame's `tty-type'
parameter, which is set by `server-create-tty-frame' and is the
canonical TERM emacs uses for this frame -- preferred over the
env value when the latter is missing or `dumb'.

Repro before this patch (Linux, ghostty + tmux, emacs daemon):

    *kitty-gfx-debug*:
      kitty-detect: nil (KITTY_PID=nil TERM_PROGRAM=tmux)
      sixel-detect: nil (TERM=dumb TERM_PROGRAM=tmux TMUX=yes
                         tmux-ver=3.6 tmux-ok=yes WT=no)
      mode: terminal not supported, aborting enable

After the patch the detectors read the frame env, so TERM
resolves to the actual `tmux-256color' / `xterm-kitty' / etc.
and the matching backend is picked.

Behaviour unchanged for non-daemon emacs: when the frame has no
`environment' parameter, `kitty-gfx--frame-getenv' falls back to
the process env directly.</content>
</entry>
<entry>
<title>fix(sixel): accept tmux/screen TERM when tmux forwards Sixel (#14)</title>
<updated>2026-04-30T08:24:23Z</updated>
<author>
<name>unship</name>
<email>liyananfamily@gmail.com</email>
</author>
<published>2026-04-30T08:24:23Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=91f9a3bbef5f275d0b8dc0a79dc4a4e0e04324ca'/>
<id>urn:sha1:91f9a3bbef5f275d0b8dc0a79dc4a4e0e04324ca</id>
<content type='text'>
`kitty-gfx--sixel-detect' currently gates on the outer TERM matching
`xterm|vt[0-9]|foot|contour'.  Once `tmux-ok' has confirmed tmux &gt;=
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)'
    =&gt; "Kitty graphics: terminal not supported"
    *kitty-gfx-debug*: sixel-detect: nil (TERM=tmux-256color ... tmux-ok=yes)</content>
</entry>
<entry>
<title>Track image placements per window</title>
<updated>2026-04-29T10:01:55Z</updated>
<author>
<name>Tim Felgentreff</name>
<email>timfelgentreff@gmail.com</email>
</author>
<published>2026-04-29T09:52:39Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=af342292b8c777a1e831acc9c05a33738a9c3eb6'/>
<id>urn:sha1:af342292b8c777a1e831acc9c05a33738a9c3eb6</id>
<content type='text'>
A buffer can be visible in more than one window.  With one last-row/last-col and one placement ID per overlay, refreshing the second window overwrites the placement state for the first.  After C-x 0, the closed pane's terminal image can no longer be addressed and remains as an artifact.

Record image placement geometry and placement IDs per live window.  Refresh and cleanup now delete the placement for the specific window, while existing last-row/last-col properties mirror the window currently being refreshed for backend compatibility.
</content>
</entry>
<entry>
<title>Delete image placements before window rerenders</title>
<updated>2026-04-29T10:01:55Z</updated>
<author>
<name>Tim Felgentreff</name>
<email>timfelgentreff@gmail.com</email>
</author>
<published>2026-04-29T09:52:26Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=e68696f0baae66cd17d4a7f0f3d021ca906f49b3'/>
<id>urn:sha1:e68696f0baae66cd17d4a7f0f3d021ca906f49b3</id>
<content type='text'>
Window layout changes move image overlays before kitty-graphics recalculates terminal positions.  Clearing last-row/last-col first loses the only geometry the backends can use to delete the old terminal placement, which leaves stale pixels over new split separators.

Delete the current recorded image placement during window-change handling before clearing the cached position.  Also make image-mode placement reuse explicit: zoom commands still reuse a PID to avoid flicker, while split/resize rerenders delete first.
</content>
</entry>
<entry>
<title>Render doc-view pages without mutating PDF buffers</title>
<updated>2026-04-29T10:01:55Z</updated>
<author>
<name>Tim Felgentreff</name>
<email>timfelgentreff@gmail.com</email>
</author>
<published>2026-04-29T09:30:59Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=064ef03881008e93699d8f3343fb19fadada68ee'/>
<id>urn:sha1:064ef03881008e93699d8f3343fb19fadada68ee</id>
<content type='text'>
Terminal doc-view rendering used to erase and insert padding/newlines into
the doc-view buffer before placing the page image.  doc-view buffers visit
the original PDF, so changing buffer text marks the document modified and
can corrupt it if saved.

Create the Kitty/Sixel page overlay over the existing buffer contents
instead.  Compute the page image dimensions, prepare/cache the page image,
and schedule a refresh without changing the visited PDF bytes.
</content>
</entry>
<entry>
<title>Handle doc-view image navigation in terminals</title>
<updated>2026-04-29T10:01:55Z</updated>
<author>
<name>Tim Felgentreff</name>
<email>timfelgentreff@gmail.com</email>
</author>
<published>2026-04-29T09:50:17Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=10cd1e5645bbc01f1bfcdb252e1a0a03693c229c'/>
<id>urn:sha1:10cd1e5645bbc01f1bfcdb252e1a0a03693c229c</id>
<content type='text'>
When kitty-graphics renders doc-view pages in a terminal, doc-view still calls image-mode navigation helpers for scrolling and edge movement. Those helpers expect an Emacs image display and can error or do nothing in the terminal renderer.

Add terminal-only doc-view advice for the image navigation functions so they update window hscroll/vscroll and schedule a graphics refresh instead.
</content>
</entry>
<entry>
<title>Fix overlay position mapping in split windows</title>
<updated>2026-04-29T10:01:55Z</updated>
<author>
<name>Tim Felgentreff</name>
<email>timfelgentreff@gmail.com</email>
</author>
<published>2026-04-29T08:40:14Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=97956b508ea435358f2b4e070158cf0c3669bec4'/>
<id>urn:sha1:97956b508ea435358f2b4e070158cf0c3669bec4</id>
<content type='text'>
Compute overlay screen positions in the window currently being refreshed
instead of choosing an arbitrary window that shows the same buffer.  This
keeps placements correct when a buffer is visible in more than one pane.

Also derive the terminal column from the overlay's buffer column rather
than posn-col-row.  In terminal Emacs, posn-col-row can describe the
right edge of display-property text instead of the logical overlay start,
which makes Sixel placements appear to the right of their reserved cells.
</content>
</entry>
<entry>
<title>Guard Sixel cleanup against nil files</title>
<updated>2026-04-29T10:01:55Z</updated>
<author>
<name>Tim Felgentreff</name>
<email>timfelgentreff@gmail.com</email>
</author>
<published>2026-04-29T07:33:44Z</published>
<link rel='alternate' type='text/html' href='http://git.cashmere.rs/kitty-graphics/commit/?id=42f0e3ef12a885e1fdf465af0547d93df692b4bc'/>
<id>urn:sha1:42f0e3ef12a885e1fdf465af0547d93df692b4bc</id>
<content type='text'>
kitty-gfx--sixel-cleanup can be called without a file when cleanup is
routed through generic backend code.  In that case the old implementation
passed nil to md5 while pruning cached Sixel temp files.

Make the cleanup a no-op when FILE is nil.
</content>
</entry>
</feed>
