term.gfx.display — Lilush API

←index

← term.gfx

Overview

On-screen display — a double-buffered placement of a canvas in the terminal.

Each :update() re-transmits the canvas pixels under a FIXED image id and re-places them under a FIXED placement id, which atomically replaces the previous frame. Pixels travel via a fresh-per-frame POSIX shared-memory object (the terminal unlinks it after reading — so it never leaks), falling back to inline base64 if shm fails.

Anchoring:

Image/placement ids come from alloc_id / alloc_placement so independent graphics apps never collide on a hardcoded id.

Functions

NameSignature
alloc_idalloc_id() -> id
alloc_placementalloc_placement() -> pid
displaydisplay(canvas, opts) -> display

alloc_id() -> id

Allocate a unique Kitty image id

alloc_placement() -> pid

Allocate a unique Kitty placement id

display(canvas, opts) -> display

Create an on-screen display for a canvas

opts shape:

NameDeafultDescription
anchorabsolutecursor or omit for current cursor
row/colcell position for absolute, column for cursor anchor
uprows+1lines to jump up for cursor anchor
z0z-index; use negative to composite behind text
cols/rowsscale the image into this cell box via the Kitty c/r keys; omit for natural pixel size)
no_cursor_movetrue
transportshmdirect for inline base64
id/placementdefault freshly allocated

Methods: