1# vendor/
2
3`ghostty-vt.wasm` is libghostty-vt built from the Ghostty source tree (MIT, `GHOSTTY-LICENSE`) at the commit pinned in `COMMIT`. `include/` is the matching C API header set, vendored for reference and as the source of truth for `gen-constants.mjs`.
4
5The vendored artifact is **pinned to the commit in `COMMIT`**. Do not update without running the full bump checklist — libghostty-vt has no tagged release, and every bump is a potential silent ABI break.
6
7## Rebuild recipe
8
9```sh
10git clone https://github.com/ghostty-org/ghostty.git # mirror; upstream is migrating forges
11cd ghostty && git checkout $(cat ../COMMIT)
12patch -p1 < <terminal-package>/vendor/patches/wasm-batched-vt.patch
13patch -p1 < <terminal-package>/vendor/patches/wasm-ascii-row.patch
14zig build -Demit-lib-vt -Dtarget=wasm32-freestanding -Doptimize=ReleaseSmall
15cp zig-out/bin/ghostty-vt.wasm <here>
16node <terminal-package>/vendor/verify.mjs <ghostty-source>
17```
18
19The local patch keeps Ghostty's existing scalar `print_slice` batching enabled
20for wasm. Upstream's `simd=false` disables native SIMD dependencies, but the
21unpatched stream also falls back to one parser action per byte even though the
22batched path has a scalar decoder.
23
24The ASCII-row patch adds a fail-closed bulk export for narrow printable cells
25with default presentation or an explicit foreground. Unsupported rows return
26`GHOSTTY_NO_VALUE` and continue through the canonical per-cell API.
27
28Zig version must match `.minimum_zig_version` in `build.zig.zon` (0.16.0 at the pinned commit). If zig's fetcher fails with `TlsInitializationFailed` against `deps.files.ghostty.org`, curl the tarball it names and `zig fetch <file>` manually, then retry.
29
30## Bump checklist
31
321. New commit into `COMMIT`, rebuild wasm, re-vendor `include/`, and replace `SHA256` with the rebuilt wasm's lowercase SHA-256.
332. `node vendor/gen-constants.mjs` — regenerates `src/ghostty/constants.ts`; a changed enum value or struct layout is an API break to review, not noise.
343. `node vendor/verify.mjs <ghostty-source>` verifies the checked-in wasm hash, required exports and type metadata, patched source metadata, and the upstream wasm-allocator page-zeroing guard. The source argument is mandatory during a bump; `pnpm verify:vendor` performs the artifact-only checks on every package check.
354. Run the package test suite; `test/lifecycle.vi.ts` re-proves the grapheme create/free cycle against the new artifact.