KetraTerm
API · v0.3.0All versions

resizeViewport

fun resizeViewport(columns: Int, rows: Int, oldScrollbackOffset: Int = 0): TerminalViewportResizeResult

Resizes the terminal and connector and captures the viewport anchor and history baseline under the same mutation lock. This keeps viewport resizes ordered with application-requested column switches.

Reflow may replace history storage and change its discarded-row counter. Consumers that retain scrollback position must adopt the complete result together, so later output is measured against the resized history.

Return

the resized viewport and history metadata from one synchronized state.

Parameters

columns

target terminal column width; must be positive.

rows

target terminal row height; must be positive.

oldScrollbackOffset

pre-resize whole-row offset, or zero for live output.