KetraTerm
API · DevelopmentAll versions

TerminalRenderFrameReader

Provides a short-lived render frame view.

The frame passed to the consumer is valid only during the callback. Implementations may hold a terminal mutation lock while invoking the consumer. Consumers must copy anything they need before returning. Readers need not support reentrant reads on the same instance. An unsupported nested read must throw IllegalStateException before disturbing the enclosing frame; that frame remains valid until its own callback returns.

A reader instance identifies one source's generation namespace for incremental consumers. Use a new reader for unrelated terminal content, or explicitly reset consumer caches before replacing the content behind an existing reader.

Functions

Link copied to clipboard

Invokes consumer with a render frame view whose lifetime is limited to this call.

open fun readRenderFrame(scrollbackOffset: Int, consumer: TerminalRenderFrameConsumer)

Invokes consumer with a render frame for a caller-owned scrollback viewport.

open fun readRenderFrame(scrollbackOffset: Int, viewportRows: Int, consumer: TerminalRenderFrameConsumer)

Invokes consumer with a render frame for a caller-owned scrollback viewport that may contain more rows than the live terminal grid.

Link copied to clipboard
open fun readRenderFrameForAbsoluteRange(startAbsoluteRow: Long, endAbsoluteRow: Long, consumer: TerminalRenderFrameConsumer)

Invokes consumer with a frame containing the retained intersection of the requested absolute row range.