Skip to content

@jsvision/core / Host

Interface: Host

Defined in: host/types.ts:93

A running terminal host, returned by createHost.

Properties

isTTY

readonly isTTY: boolean

Defined in: host/types.ts:95

True when both the bound output and input are a real TTY.

Methods

render()

render(buffer, trailer?): void

Defined in: host/types.ts:113

Paint a frame. Diffs buffer against the previously rendered frame and writes only the changed cells as one coalesced write.

trailer (optional) is appended to that same write — typically the show-and-move-cursor sequence — so the terminal never repaints between the damage and the cursor move (a separate write would flash the cursor at the last damaged cell for one frame). A trailer is written even when the diff is empty.

Parameters

buffer

ScreenBuffer

The frame to render.

trailer?

string

Extra bytes to append to the same write (e.g. a cursor move).

Returns

void


start()

start(): Promise<void>

Defined in: host/types.ts:97

Take over the terminal: bind streams, enter raw mode + the configured screen modes, install handlers. Idempotent.

Returns

Promise<void>


stop()

stop(): Promise<void>

Defined in: host/types.ts:99

Give the terminal back: leave modes, restore cooked mode / main screen / cursor, remove handlers. Idempotent; does not exit.

Returns

Promise<void>