Skip to main content

SCROLLBAR

Constant SCROLLBAR 

Source
pub const SCROLLBAR: Type = 9;
Expand description

Scrollbar state for the terminal viewport.

This is amortized O(1): the total is maintained incrementally as the terminal is modified and the viewport offset is cached. The first read after the viewport moves to an arbitrary position that isn’t an absolute row (e.g. scrolling to a selection) may cost O(pages) to compute the offset, after which it is cached again.

There is intentionally no change notification for scroll state. Callers building scrollbars should poll this once per frame or per write batch and diff the result to detect changes; this is what Ghostty’s own renderer does.

Output type: GhosttyTerminalScrollbar *