summaryrefslogtreecommitdiff
path: root/test/kitty.zig
Commit message (Collapse)AuthorAge
* dump: one walker dump of the whole session, by name across builds, for ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | Restore, -l, Handover and the store; dump.zig's hand-written schema gone A dump is walk.zig's walk of the core with a table of every type it reaches (fields, enum and union names, number widths), read back by name; terminals are ghostty's snapshot (screens, history, kitty images); a failed load frees what it made. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* tests on FreeBSD: Linux's /proc/1 fixtures, the builtins lists, daemon.py ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | and fs.py without /proc - The refusing directory some tests name is Linux's /proc/1/root: that part skips elsewhere. The committed builtins-*.json are Linux builds' (Tty9p): their check skips, and a key the docs give a word this build leaves out is found in the other's list. - kitty: a shared memory object is sized before it is written (FreeBSD's write does not grow it); a FIFO in /dev/shm is Linux's case. - daemon.py asks ps and procstat where there is no /proc, and finds bash on PATH. fs.py runs printenv once a name, and skips two permission checks as root, who searches and writes anywhere. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* kitty z-index: a terminal image's z= goes with it, images go to the shell ↵Gabriel Schneider2026-10-28
| | | | | | | | | | | | lowest first, and the tty hands z on to the outer terminal (under the text below 0); real clients recorded, replayed and run live z-index was lost: an ImagePlace had none, so every image went over the cells in hash-map order, a z<0 picture (a background under text) over the text and overlapping images in any order. ImagePlace.z now carries the placement's z (a virtual placement's from its placeholder target), TerminalImages sorts what it appends lowest z first (stable), and the tty's exactKittyPlacement sets vaxis's z_index, so a kitty terminal outside stacks them and puts z<0 under the text. The GUI draws them in that order but still over the cells: under the text there needs a glyph pass after the images (ui.frag's clear_bg_bit) in gui.zig's vertex buffer. Real clients: test/kitty_harness.zig's PARDES_KITTY_EXPLORE runs commands in the pane under script(1) and prints what pardes placed outside; kitten icat 0.49.2 (--align left/center/right, --place, --scale-up, --unicode-placeholder, --clear, file/memory/stream/detect), chafa 1.18.3, viu and yazi 26.9.1 all landed where they should. Their recorded traffic (test/kitty-fixtures/*.vt) replays through the core (test/kitty.zig) to the cells they drew live. The harness now also runs yazi live (shared memory, a virtual placement, placeholders), checks z=-1 outside, and runs a second pardes under a terminal without kitty graphics: no graphics command reaches it and the image is glyph art in all 32 cells. The harness empties NO_COLOR (zig build sets it, and vaxis drew no colour at all under the harness) by setenv, not unsetenv, which compacts the environment std captured. Also: tests that a pane's image follows pardes's own scrollback, an edited copy taller than its rows, a narrow pane's edge, Collapse and a cell-size change; and a knownGap: images do not survive a dump (Dump, Handover, a pane reopened from the Store), whose VT text has none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* kitty fuzz: seeded random kitty traffic through a terminal pane ↵Gabriel Schneider2026-10-28
| | | | | | | | | | (test/kitty.zig), in kitty-test and unit-test Commands with any action, keys and values (huge, negative, zero, junk), payloads valid and broken (base64, a cut PNG), CAN, SUB and ESC mid-command, half of them loads and placements with random geometry so they reach the storage and the frame; placeholders with every diacritic, 24-bit and 256-colour ids and underline-colour placements; cursor moves, scroll regions, insert/delete lines, ED 2/3, the alternate screen; window and cell-size resizes and grid resizes; frames between; every batch split into reads anywhere. Each seed checks no crash, no leak (the testing allocator) and that every answer parses as a whole ESC _ G ... ESC \ or CSI. A bad answer shrinks to its shortest failing prefix; PARDES_KITTY_FUZZ=<seeds>, PARDES_KITTY_FUZZ_SEED and PARDES_KITTY_FUZZ_STEPS for long runs and replays. Found nothing: 900 seeds of 400 steps pass, with frames drawing up to 42 places. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* kitty media: a FIFO, device or huge file named by t=f, t=t or t=s no longer ↵Gabriel Schneider2026-10-28
| | | | | | | | | | | | hangs pardes or swells it (ghostty's loader patched at build time) A program in a pane that named a FIFO (`mkfifo /tmp/f`, then t=f, t=t, or t=s through /dev/shm) hung the whole editor: ghostty's loader opens the path and only then checks that it is a regular file, and an open for reading waits for a writer. A device was opened too before being refused (an open may do something), and any image file up to ghostty's 400 MB was read and held before a screen's 64 MiB storage could refuse it. build.zig's patchGhosttyKitty patches src/terminal/kitty/graphics_image.zig with count-checked anchors, as vaxis and mvzr are: on Linux a path is probed with O_PATH (which opens nothing), must be a regular file, and that same inode is reopened through /proc/self/fd; shared memory must be a regular file (stat of /dev/shm/<name> first, then shm_open non-blocking and fstat); max_size is TerminalImages.storage_limit. Which paths are accepted stays ghostty's (kitty's) policy, which the user accepts. Tests: a FIFO by each medium and through a /dev/shm symlink does not block (a watchdog thread opens it for writing after 1.5 s and the test fails if it had to); /proc, /sys, devices and directories are refused; t=t leaves a tty-graphics-protocol file outside the temp directory, and one behind a /tmp symlink; a 100 MiB file is refused. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* kitty graphics conformance for terminal panes: a core suite (test/kitty.zig, ↵Gabriel Schneider2026-10-28
`zig build kitty-test`, in unit-test) and an end-to-end harness (`zig build kitty-harness`, tty and gui); four gaps it found fixed, one left The core suite feeds a pane's output as pty reads do and checks what the program reads back, ghostty's image storage and the ImagePlaces a frame draws: queries and their errors, q=0/1/2, f=24/32/100 and o=z, chunked m=1 split at every read size, t=f/t=t/t=s, a=T and C=1 cursor movement, a=p by placement id with source rects and re-puts, image numbers, every d= delete (a/A i/I n/N c/C p/P q/Q x/X y/Y z/Z r/R) and a delete abandoning a chunked load, Unicode placeholders over two rows with implicit columns and a placement named in the underline colour, scroll/resize/reflow, the alternate screen, clear (ED 2 + ED 3), replies per pane and never in the cells, many replies from one read, kitty before DA, CAN/SUB, an oversized image, 300 images against the storage limit, animations and relative placements. The harness runs test/kitty_client.zig in a pane's bash (query, a 16-chunk 8x4-cell place, the three media, quiet levels, CAN, show then delete) and kitten icat (stream and detect) and chafa when installed. Outside, the tty arm is a kitty terminal (a ghostty-vt emulator): the image pardes re-emits lands at the cell after ANCHOR>, 8x4 cells a row at a time, the client's own commands and replies never pass through, and d=I frees what was sent. The gui arm reads the GPU capture. Fixed: kitty file, temporary-file and shared-memory media (libghostty defaults to direct only; now allWithTempDir like ghostty and kitty); replies past 256 bytes of one read were cut mid-sequence (4 KiB now, an answer that does not fit dropped whole and counted); animations never played (TerminalImages draws renderData(), ticks ImageStorage.animationTick on the core clock, nextWake wakes for the next frame); relative placements (P=/Q=/H=/V=) were not drawn (resolveChain, as ghostty's renderer). image.decode no longer jumps through stb_image's null allocator before image.start. Known gap (a knownGap test): no z-index; every image is drawn over the cells in storage order. Co-Authored-By: Claude Opus 5.5 <[email protected]>