Files
ghostty/example/c-vt-snapshot
Mitchell Hashimoto 219173ab37 terminal/snapshot: remove BLAKE3 digests
Remove BLAKE3 prefix digests. Keep READY/FINISH as empty records since
they're semantically important markers.

Our existing format (CRC32 per-record, declared counts, strict tag ordering
requirements, etc.) already detect: accidental corruption, truncation,
data omission, and duplication. 

BLAKE3 only protects against valid records being swapped or removed entirely. 
It is heavy for just that, and callers can solve that anyways via their
own transport (like, just use TCP). For more adversarial protection,
callers can also add layers like TLS or their own alternate signing
methods depending on their own threat models.

Removing the hash improves encode times by ~1.4x, decode times by ~1.3x.
Time-to-READY decoding is effectively unchanged because it was such a 
small package to begin with.
2026-08-06 14:12:08 -07:00
..

Example: Terminal Snapshots in C

This example creates a terminal with continuation tracking, encodes its full state, and restores the snapshot using both the one-shot and incremental C decoder APIs. The incremental path uses a synchronous GhosttyReader callback and reports each restored history page. The standalone project links the static libghostty-vt artifact so it can run consistently on every supported host.

Usage

Run the example:

zig build run