tuil
ReferencePackages

@mwillbanks/tuil-ghostty-web

Browser adapter that runs existing TUIL Ink applications inside Ghostty Web.

View rawEdit

Overview

Browser adapter that runs existing TUIL Ink applications inside Ghostty Web.

@mwillbanks/tuil-ghostty-web is independently installable and also participates in the umbrella @mwillbanks/tuil runtime where applicable.

Installation

npm install @mwillbanks/tuil-ghostty-web

How it operates

The optional browser adapter connects the existing Ink runtime to Ghostty Web through bounded TTY streams, ordered output, input forwarding, resize events, and a semantic DOM companion.

Documentation flow diagram. lazy WASM initialization; terminal mount; stream bridge; resize and input; deterministic disposal; S0 leads to S1; S1 leads to S2; S2 leads to S3
Documentation flow diagram. lazy WASM initialization; terminal mount; stream bridge; resize and input; deterministic disposal; S0 leads to S1; S1 leads to S2; S2 leads to S3

API

APISignatureDescription
createTuilGhosttyDocumentAppexport createTuilGhosttyDocumentAppPublic export createTuilGhosttyDocumentApp.
createTuilGhosttyDocumentSessionexport createTuilGhosttyDocumentSessionPublic export createTuilGhosttyDocumentSession.
createTuilGhosttyFeasibilityAppexport createTuilGhosttyFeasibilityAppPublic export createTuilGhosttyFeasibilityApp.
createTuilGhosttyStoryAppfunction createTuilGhosttyStoryAppPublic function createTuilGhosttyStoryApp.
generatePlaygroundTsxexport generatePlaygroundTsxPublic export generatePlaygroundTsx.
initializeTuilGhosttyfunction initializeTuilGhosttyPublic function initializeTuilGhostty.
mountTuilGhosttyfunction mountTuilGhosttyPublic function mountTuilGhostty.
playgroundComponentCatalogexport playgroundComponentCatalogPublic export playgroundComponentCatalog.
PlaygroundDocumentV1export PlaygroundDocumentV1Public export PlaygroundDocumentV1.
PlaygroundNodeV1export PlaygroundNodeV1Public export PlaygroundNodeV1.
TuilGhosttyAccessibilityOptionsinterface TuilGhosttyAccessibilityOptionsPublic interface TuilGhosttyAccessibilityOptions.
TuilGhosttyInstanceinterface TuilGhosttyInstancePublic interface TuilGhosttyInstance.
TuilGhosttyMountOptionsinterface TuilGhosttyMountOptionsPublic interface TuilGhosttyMountOptions.
TuilGhosttyStoryOptionsinterface TuilGhosttyStoryOptionsPublic interface TuilGhosttyStoryOptions.
TuilGhosttyTerminalOptionsinterface TuilGhosttyTerminalOptionsPublic interface TuilGhosttyTerminalOptions.
validatePlaygroundDocumentexport validatePlaygroundDocumentPublic export validatePlaygroundDocument.

Events and lifecycle

Ghostty input enters the existing Ink input pipeline. Output and lifecycle failures reach the owning TUIL error boundary.

All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.

Example

import { mountTuilGhostty } from "@mwillbanks/tuil-ghostty-web";

const terminal = await mountTuilGhostty({ app, element });
await terminal.unmount();

On this page