openclaw / openclaw/libterminal

feat(browser): adopt Ghostty v1.4 WASM through a maintained upstream wrapper

Open
#41 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

dependencies enhancement issue-rating: 🌊 off-meta tidepool P3
Dominant language
Python
Stars
6
Forks
8
Avg merge
5h 25m
Merged PRs (30d)
28

Description

Problem

@openclaw/libterminal currently pins ghostty-web@0.4.0, whose bundled WASM predates Ghostty's v1.4.0 VT throughput work and native libghostty-vt terminal/render APIs.

Ghostty's July 2026 parser changes report roughly 1.5x to 6x throughput improvements, but those changes are currently available only on Ghostty main/tip. Adopting an unreleased commit or maintaining a private ABI patch in this repository would make libterminal responsible for an unstable upstream boundary.

Upstream gates

Do not start the dependency upgrade until both conditions are true:

  • Ghostty publishes a stable v1.4.0 tag.
  • A maintained upstream package publishes a Ghostty v1.4-compatible browser/WASM wrapper that provides the runtime and terminal surface libterminal consumes.

Tracking:

Ownership boundary

libterminal must not fork, patch, or port the Ghostty C/WASM ABI.

Consume a maintained upstream release with a reproducible build and stable package contract. If no compatible upstream wrapper is published, leave this issue blocked rather than importing that ABI maintenance burden into libterminal.

Proposed work

  • Replace the ghostty-web@0.4.0 pin with the stable compatible release.
  • Confirm the wrapper still exposes the browser runtime surface used by loadGhosttyRuntime, including initialization, terminal construction, fitting, writes, resize, disposal, and input events.
  • Regenerate the embedded Worker module, WASM, and browser-external assets with pnpm run generate:worker-assets.
  • Verify Node asset serving still resolves the exact module and WASM shipped by the pinned package.
  • Re-evaluate the default-color query compatibility responder. Remove or narrow it only if the new wrapper demonstrably emits the required OSC 10-12 responses itself.
  • Add an Unreleased changelog entry describing the runtime dependency and performance change.

Performance evidence

Capture comparable before/after results using the existing ghostty-web@0.4.0 build as the baseline:

  • sustained terminal write/parse throughput for plain text, Unicode/CJK, and escape-heavy output
  • end-to-end browser write-to-render time under high output
  • startup/WASM initialization time
  • shipped WASM and generated Worker asset size
  • peak memory under a bounded scrollback workload

The goal is to prove a meaningful product-level improvement, not repeat upstream parser-only benchmark claims.

Acceptance criteria

  • The dependency is pinned to a stable published version, not Ghostty main, tip, a Git commit, or a locally patched artifact.
  • No Ghostty ABI implementation or compatibility fork is added to this repository.
  • Existing browser, Worker, and Node asset APIs remain compatible.
  • Focused runtime tests and asset byte-integrity tests pass.
  • Browser smoke proves a nonblank terminal, input, resize, disposal, and sustained high-output rendering.
  • Before/after performance and artifact-size results are recorded in the pull request.
  • pnpm test, pnpm test:browser, pnpm check, and pnpm run check:release pass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

First verify that Ghostty v1.4.0 and a maintained compatible browser/WASM wrapper are published; otherwise leave the issue blocked. Inspect the loadGhosttyRuntime surface and run pnpm run generate:worker-assets, then review the focused runtime and asset-integrity tests. Done means the stable dependency, browser/Worker/Node assets, smoke tests, performance results, and required pnpm checks all pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript, wasm
Domain
build-system, frontend, performance, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.