<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pardes.git/src/TerminalImages.zig, branch release-0.24</title>
<subtitle>Pardes</subtitle>
<id>https://git.0x4200.cafe/pardes.git/atom?h=release-0.24</id>
<link rel='self' href='https://git.0x4200.cafe/pardes.git/atom?h=release-0.24'/>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/'/>
<updated>2026-10-01T03:53:56Z</updated>
<entry>
<title>A terminal's kitty graphics draw as glyph art where pixels cannot, and by choice: Petscii on the pane, TermImages for new ones</title>
<updated>2026-10-01T03:53:56Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-01T03:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=0bb65902ebec104dac954b59f28500812419e1af'/>
<id>urn:sha1:0bb65902ebec104dac954b59f28500812419e1af</id>
<content type='text'>
Under an outer terminal without kitty graphics a tty pardes cannot pass a
terminal pane's images on, so it draws them itself as an image pane's
Petscii does: each row of an image is matched to C64-palette glyph art
over the cells it covers (GlyphArt.renderRect, the exact-grid half of
GlyphArt.render), cached while it is on screen. yazi is still told the
kitty protocol works, so it keeps sending its previews.

The same art is a choice anywhere: the Petscii builtin now takes a
terminal pane too (PaneKind.picture), flipping its images between pixels
and glyphs, and a terminal holding images, or drawing them as glyphs by
choice, says petscii:on|off in its tag as an image pane does. TermImages
real|petscii (default real) is what a new terminal starts with; it is in
DumpConfig, /ctl and the reference.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>A terminal pane draws the kitty graphics its program places, so yazi's image and PDF previews show</title>
<updated>2026-10-01T03:53:17Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-01T03:35:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=28c74918cde4092d964daa847c026ed3de282683'/>
<id>urn:sha1:28c74918cde4092d964daa847c026ed3de282683</id>
<content type='text'>
yazi asks the pane XTVERSION, and ghostty-vt answers "libghostty": yazi
takes it for Ghostty and sends its previews by the kitty graphics protocol
with Unicode placeholders (a=T,U=1, then U+10EEEE cells). ghostty-vt stored
the images, but nothing drew them: the placeholders showed as tofu in the
GUI and as raw codepoints in the tty, in every build since terminal panes
answered queries (vkznsvzs, 2026-07-01). Before that no query was answered
and yazi fell back to chafa's text art.

Each frame, TerminalImages.zig reads the active screen's images and
placements (virtual ones through their placeholder runs, and ones placed on
a cell), cuts each into the cell rows it covers, maps those rows through
the body's own row walk, clips them to the pane, and hands them on as
ImagePlaces with exact geometry (NativePlacement.exact). The GUI draws
them as textures; the tty passes them to an outer terminal with kitty
graphics as one placement per row, its source cropped to whole cells.
Placeholder cells draw no text. Scrolling, a delete, a resize, the
alternate screen and a closed pane all fall out of reading the emulator's
state every frame.

A pane now knows its size in pixels: CSI 14/16/18 t are answered, the
emulator's width_px/height_px follow the shell's cells, and the pty's
winsize carries pixels (host_io.ptyWinsize), so yazi and a nested pardes
size their images right. ghostty-vt's image store is 64 MiB per screen
(its library default, 10 MB, refused a large preview), PNG transmissions
are decoded with stb_image, and RGB images are converted only while shown.

test/yazi_preview.py runs yazi in a hidden window on a PNG and a PDF and
checks the captures, also through a tty pardes nested in the pane.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
