gespenst API - v0.1.0
    Preparing search index...

    Class GespenstTerminal

    Browser terminal combining Ghostty VT state, worker isolation, rendering, DOM input, and PTY streams.

    Create terminals through createTerminal. The terminal owns every resource activated through it and releases those resources together through GespenstTerminal.dispose.

    const terminal = await createTerminal({ container });
    terminal.write('\x1b[32mready\x1b[0m\r\n');
    terminal.focus();

    Implements

    Index
    element: HTMLElement

    Root DOM element owned by the terminal.

    renderer: RendererInfo

    Active renderer and shaping implementation.

    • Subscribes to a typed browser terminal event.

      Type Parameters

      • Key extends
            | "error"
            | "resize"
            | "input"
            | "bell"
            | "title"
            | "cwd"
            | "notification"
            | "progress"
            | "clipboardWrite"
            | "bufferChange"
            | "renderer"
            | "writeParsed"
            | "selectionChange"
            | "scroll"
            | "viewportChange"
            | "font"

      Parameters

      Returns Disposable

    • Fits to the container or applies an explicit character-grid size.

      Parameters

      • Optionalcols: number
      • Optionalrows: number

      Returns void

      Calling without both dimensions respects fixed cols and rows creation options. Use GespenstTerminal.fit to force container measurement.

    • Queues terminal output for VT parsing without waiting for the next rendered frame.

      Parameters

      • data: string | Uint8Array<ArrayBufferLike>

      Returns void