Files
ghostty-rs/crates/ghostty-terminal/src/kitty/mod.rs
T
ddidderr d47408f31c feat(terminal): port kitty graphics protocol storage and execution
Ports ZIG/src/terminal/kitty/graphics_*.zig:
- image loading for direct, file, temp-file and shared-memory
  transmissions (rustix::shm, no unsafe), chunking, zlib and PNG decode
- image storage with placements (incl. virtual) tracked by PageList pins,
  all delete modes, byte-limit eviction and dirty tracking
- unicode placeholder decoding and placement iteration
- command execution, generic over an ExecTerminal trait

Deviations: storage methods take the PageList explicitly; evicted or
replaced placements now release their tracked pins (Zig leaks them);
file transmissions with S= truncate per the kitty spec. Zig quirks kept
for parity: delete-range matches all placements, eviction stops only
after freeing strictly more than requested, set_limit(0) resets.

Not yet wired: Screen still holds the KittyImages placeholder, so
Terminal does not implement ExecTerminal; integration steps are in
docs/rewrite/notes/ghostty-terminal-kitty.md.

Test Plan:
- cargo test -p ghostty-terminal (66 kitty tests; all Zig tests ported)
2026-10-11 22:52:07 +02:00

27 lines
877 B
Rust

//! Kitty graphics protocol support (`ZIG/src/terminal/kitty.zig` and
//! `ZIG/src/terminal/kitty/graphics.zig`).
//!
//! Documentation:
//! <https://sw.kovidgoyal.net/kitty/graphics-protocol>
//!
//! Unimplemented features that are still todo (same as Ghostty):
//! - animation
//!
//! The command parser lives in `ghostty_vt::kitty::graphics_command`; the
//! types most callers need are re-exported here.
pub mod graphics_exec;
pub mod graphics_image;
pub mod graphics_render;
pub mod graphics_storage;
pub mod graphics_unicode;
pub use ghostty_vt::kitty::{color, graphics_command, key};
pub use graphics_command::{Command, Parser as CommandParser, Response};
pub use graphics_exec::{ExecTerminal, execute};
pub use graphics_image::Image;
pub use graphics_render::Placement as RenderPlacement;
pub use graphics_storage::ImageStorage;
pub use graphics_unicode as unicode;