T3 Code 非官方中文翻译不是官方产品,也不是 T3 Tools 官方文档。源提交 d2c25950b4d9中文译文GitHub 源文件
Skip to content

Ghostty web terminal ​

This directory is the browser adapter for the same official libghostty-vt C ABI used by Android. It is intentionally not an xterm compatibility layer.

  • runtime.ts owns the singleton WebAssembly instance and runtime ABI layouts.
  • vendor/ghostty-write-pty.wasm is a 112-byte callback trampoline for terminal-generated PTY replies.
  • core.ts owns per-terminal Ghostty handles and translates the C ABI into render snapshots.
  • renderer.ts batches backgrounds and style runs into a Canvas 2D frame.
  • surface.ts owns browser input, IME, selection, scrolling, sizing, links, and cursor blinking.
  • fonts/ vendors the symbols-only Nerd Font (MIT) the surface registers lazily, so prompt glyphs render without a locally installed Nerd Font.
  • vendor/ holds only the artifacts, reproducibly generated by apps/web/scripts/build-libghostty-wasm.sh. The upstream pin and license live once, at native/libghostty-vt/ at the repository root; the wasm embeds the pinned revision in its build info and the ABI test verifies it against mobile's VERSION.

Keep browser behavior here and terminal transport in the existing client runtime. Do not add React state to the render loop. Both WASM artifacts are ordinary read-only assets, not executables.

非官方译文 · 源提交 d2c25950b4d9 · 不代表 T3 Tools