Files
ghostty/example/c-vt-compression
Mitchell Hashimoto 03d5fa2689 lib-vt: move scrollback limits to terminal_set
Terminal construction previously accepted GhosttyTerminalOptions with
dimensions and one scrollback byte limit. Remove the options struct from
the ABI and make ghostty_terminal_new accept columns and rows directly.

Add byte and line limit options to ghostty_terminal_set and forward them
to the runtime Terminal setters. NULL removes a limit, while zero bytes
disables scrollback. Update type metadata, tests, and all API examples.
2026-07-27 07:14:40 -07:00
..

Example: Scrollback Compression in C

This example shows how a libghostty-vt embedding application can track compression-relevant terminal activity and perform incremental scrollback compression after its own idle delay.

libghostty-vt does not create a timer or background thread. The embedding application remains responsible for scheduling compression and serializing it with other access to the terminal.

Usage

Run the example:

zig build run