MCPcopy Create free account
hub / github.com/coder/ghostty-web / write

Method write

lib/ghostty.ts:342–348  ·  view source on GitHub ↗
(data: string | Uint8Array)

Source from the content-addressed store, hash-verified

340 // ==========================================================================
341
342 write(data: string | Uint8Array): void {
343 const bytes = typeof data === 'string' ? new TextEncoder().encode(data) : data;
344 const ptr = this.exports.ghostty_wasm_alloc_u8_array(bytes.length);
345 new Uint8Array(this.memory.buffer).set(bytes, ptr);
346 this.exports.ghostty_terminal_write(this.handle, ptr, bytes.length);
347 this.exports.ghostty_wasm_free_u8_array(ptr, bytes.length);
348 }
349
350 resize(cols: number, rows: number): void {
351 if (cols === this._cols && rows === this._rows) return;

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.80

Tested by

no test coverage detected