Skip to content

EmscriptenTTYOps

Defined in: packages/runtime/src/wasm/types.ts:144

The operations Emscripten calls for TTY I/O. Override these to implement custom read/write, termios, and winsize behavior.

fsync(tty): void

Defined in: packages/runtime/src/wasm/types.ts:150

Flush buffered output — called by fflush() and on exit.

EmscriptenTTYDevice

void


get_char(tty): number | null

Defined in: packages/runtime/src/wasm/types.ts:146

Return the next input byte, or null to signal EOF / no data.

EmscriptenTTYDevice

number | null


ioctl_tcgets(tty): EmscriptenTermios

Defined in: packages/runtime/src/wasm/types.ts:152

Return current termios state (TCGETS).

EmscriptenTTYDevice

EmscriptenTermios


ioctl_tcsets(tty, optional_actions, data): number

Defined in: packages/runtime/src/wasm/types.ts:154

Apply new termios state (TCSETS). Return value is ignored in practice.

EmscriptenTTYDevice

number

EmscriptenTermios

number


ioctl_tiocgwinsz(tty): [number, number]

Defined in: packages/runtime/src/wasm/types.ts:160

Return terminal window size as [rows, cols] (TIOCGWINSZ).

EmscriptenTTYDevice

[number, number]


put_char(tty, val): void

Defined in: packages/runtime/src/wasm/types.ts:148

Write one output byte; null or 0 should be no-ops.

EmscriptenTTYDevice

number | null

void