resize
Resizes the terminal to newWidth x newHeight.
Existing content is reflowed to the new width. The cursor is relocated to the corresponding position in the reflowed content. Height-only changes retain physical primary rows without reflow, adjusting blank rows and the viewport boundary. Scrollback history is preserved within the configured capacity. Both the primary and alternate grids are resized, and both screen buffers reset their scroll regions to the full viewport. Tab stops are resized non-destructively: surviving custom stops are preserved, stops past the new width are dropped, and any newly exposed columns receive the default 8-column VT rhythm. Saved-cursor state is clamped to the new bounds.
Invalid dimensions are rejected before allocation or state mutation. An unchanged grid preserves known pixel dimensions. A changed grid makes them unknown; use the pixel-aware overload when the host can supply them.
Return
A Pair of (newScrollbackOffset, newHistorySize), allowing the caller to re-anchor a scrollback viewport that was active at oldScrollbackOffset before the reflow. Both values describe the active buffer, with the offset clamped to its history. An active alternate screen returns zero for both values.
Parameters
New terminal width in cells. Must be at least io.github.ketraterm.core.TerminalBuffers.MIN_WIDTH.
New terminal height in rows. Must be > 0.
The active scrollback offset before the resize.
Throws
Resizes the grid and records text-area pixels as one completed operation.
Grid semantics and the returned viewport anchor match the three-argument overload. Pixel-only changes preserve grid content, history, cursor, margins, tab stops, and text-row generations. Image geometry changes may advance graphics and frame generations. A changed grid or pixel size emits one mode 2048 report when subscribed and permitted. If either pixel dimension is zero, both become unknown. Invalid dimensions are rejected before allocation or state mutation.
Return
(newScrollbackOffset, newHistorySize) for the active buffer; the offset is clamped to retained history, and alternate returns (0, 0).
Parameters
width in cells, at least io.github.ketraterm.core.TerminalBuffers.MIN_WIDTH.
positive height in rows.
active scrollback offset before the resize.
text-area width excluding host padding; zero means unknown.
text-area height excluding host padding; zero means unknown.