@std/cli/screen.ms#
Import each required symbol with import Name from "@std/cli/screen.ms".
Screen Type#
Rows drawn so far and where the cursor was left, for diffing the next draw.
Manuscript
opaque type Screen {
}Screen.draw#
Draws rows on terminal and leaves the cursor at cursor_row (an index into
rows; a negative value means the first row) and cursor_column (0 is the left
edge).
Manuscript
var fn draw(terminal RawTerminal, rows List[String], cursor_row Int, cursor_column Int) Result[Void, Error]Screen.render#
The bytes that turn what was drawn last into rows, which also become what was
drawn last. draw writes them; tests and custom outputs can use them directly.
Manuscript
var fn render(rows List[String], cursor_row Int, cursor_column Int) StringScreen.reset#
Forgets what was drawn, for use after something wrote to the terminal behind the screen; the next draw starts at the cursor.
Manuscript
var fn reset() VoidScreen.resize#
Updates the terminal height after a Resize event.
Manuscript
var fn resize(rows Int) Voidscreen Function#
A screen that starts drawing at the current cursor row; the height is the terminal’s, or 24 when unknown.
Manuscript
fn screen() Screen { ... }