feat(ui): kitty graphics layer and terminal detection #70
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/66-kitty-graphics-layer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds the terminal-graphics layer for inline images (#60): detection of kitty-graphics terminals and the escape sequences that draw an image as Unicode placeholder cells, so it scrolls and clips like text. Nothing user-visible changes yet.
Changes
internal/ui/termimg:Transmit,Place,Delete,Cells, theIDsallocator (IDs 16-255, least-recently-used reuse with a delete), and theDetector. Every cell carries row and column diacritics and the ID as a38;5;Nforeground; tmux output is wrapped inansi.TmuxPassthrough.Deps.Detect(zero value means no detection, so existing tests never probe the terminal). Outside tmux it needs XTVERSION to name kitty or ghostty and the graphics query answered before DA1 within 1 s; inside tmux it needsallow-passthroughon/all and a kitty/ghostty client terminal type. Colour profile must be at least ANSI256. Cell size fromCSI 16 t, default 8x16. tmux settings are never changed.ui.Appreceives the detection result and holdsSupport.x/ansi,ultravioletandcolorprofilebecome direct requirements (already in the module graph; no new module). ADR 0016's module path corrected;docs/architecture.mdandCLAUDE.mdname the new package.Decisions
TransmitsetsTransmission: kitty.Direct(without it no image data is sent) and returns""on an encode failure; if the tmux probes pass and the timeout fires before DA1, support is on only when the colour profile is at least ANSI256.Test plan
make build,make test(race, ~18 s),go vet,gofumpt,go mod tidy -diff, and golangci-lint v2.14.0 (built locally; 0 issues). shellcheck is not installed locally; CI covers it.tea.Programrenders into a buffer at ANSI256 while the viewport scrolls and the test asserts placeholders, diacritics and38;5;Nsurvive the renderer; it passes 30 of 30 runs and fails if the diacritics or the 256-colour ID are dropped.png.Encodealready rejects zero-size images).Follow-ups
Refs #66
🤖 Generated with Claude Code
https://claude.ai/code/session_01APHERaPcnmg6YuAkRuoDYq