@devries-cameron20 / t3code Mirror · read-only / commits / 964cc27901
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 19:00 UTC

refactor: move the canonical libghostty-vt vendor to the repository root (#5102)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Wout Stiens committed Jul 31, 2026 at 14:20 UTC 964cc279014f512b4fc4c719377403417744ace2
40 files changed +13 -13
apps/mobile/modules/t3-terminal/README.md
+1 -1
@@ -40,7 +40,7 @@ fails, run `xcodebuild -downloadComponent MetalToolchain`.
40 ## Rebuilding libghostty-vt for Android
41
42 The checked-in Android shared libraries and headers are pinned to the revision recorded in
43 -`Vendor/libghostty-vt/VERSION`. Set `ANDROID_NDK_HOME` and run:
43 +`native/libghostty-vt/VERSION` at the repository root. Set `ANDROID_NDK_HOME` and run:
44
45 ```bash
46 apps/mobile/modules/t3-terminal/scripts/build-libghostty-android.sh
apps/mobile/modules/t3-terminal/THIRD_PARTY_NOTICES.md
+1 -1
@@ -25,7 +25,7 @@ The web terminal vendors a WebAssembly build from the same revision and uses the
25 - License: MIT
26
27 Ghostty's MIT license applies to the vendored Android and web libraries. Keep this notice and both
28 -artifacts in sync when updating `Vendor/libghostty-vt`.
28 +artifacts in sync when updating the repository-root `native/libghostty-vt`.
29
30 ## MesloLGS NF (Android terminal font)
31
apps/mobile/modules/t3-terminal/android/src/main/cpp/CMakeLists.txt
+1 -1
@@ -13,7 +13,7 @@ add_library(t3terminal SHARED t3_terminal_jni.cpp)
13
14 target_include_directories(
15 t3terminal
16 - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../Vendor/libghostty-vt/include"
16 + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../../native/libghostty-vt/include"
17 )
18
19 target_link_options(
apps/mobile/modules/t3-terminal/scripts/build-libghostty-android.sh
+1 -1
@@ -4,7 +4,7 @@ set -euo pipefail
4
5 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6 MODULE_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
7 -VENDOR_DIR="${MODULE_DIR}/Vendor/libghostty-vt"
7 +VENDOR_DIR="${MODULE_DIR}/../../../../native/libghostty-vt"
8 PATCH_DIR="${SCRIPT_DIR}/libghostty-android-patches"
9
10 GHOSTTY_REVISION="${GHOSTTY_REVISION:-9f62873bf195e4d8a762d768a1405a5f2f7b1697}"
apps/web/scripts/build-libghostty-wasm.sh
+2 -2
@@ -5,10 +5,10 @@ set -euo pipefail
5 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6 WEB_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
7 REPO_DIR="$(cd "${WEB_DIR}/../.." && pwd)"
8 -MOBILE_VENDOR_DIR="${REPO_DIR}/apps/mobile/modules/t3-terminal/Vendor/libghostty-vt"
8 +CANONICAL_VENDOR_DIR="${REPO_DIR}/native/libghostty-vt"
9 VENDOR_DIR="${WEB_DIR}/src/terminal/ghostty/vendor"
10
11 -GHOSTTY_REVISION="$(tr -d '[:space:]' < "${MOBILE_VENDOR_DIR}/VERSION")"
11 +GHOSTTY_REVISION="$(tr -d '[:space:]' < "${CANONICAL_VENDOR_DIR}/VERSION")"
12 GHOSTTY_SOURCE_DIR="${GHOSTTY_SOURCE_DIR:-${HOME}/.cache/t3code/ghostty-${GHOSTTY_REVISION:0:8}}"
13 GHOSTTY_ZIG_VERSION="${GHOSTTY_ZIG_VERSION:-0.15.2}"
14 GHOSTTY_ZIG="${GHOSTTY_ZIG:-}"
apps/web/src/terminal/ghostty/README.md
+1 -1
@@ -12,7 +12,7 @@ It is intentionally not an xterm compatibility layer.
12 prompt glyphs render without a locally installed Nerd Font.
13 - `vendor/` holds only the artifacts, reproducibly generated by
14 `apps/web/scripts/build-libghostty-wasm.sh`. The upstream pin and license live once, at
15 - `apps/mobile/modules/t3-terminal/Vendor/libghostty-vt/`; the wasm embeds the pinned revision
15 + `native/libghostty-vt/` at the repository root; the wasm embeds the pinned revision
16 in its build info and the ABI test verifies it against mobile's `VERSION`.
17
18 Keep browser behavior here and terminal transport in the existing client runtime. Do not add React
apps/web/src/terminal/ghostty/runtimeAbi.test.ts
+5 -5
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vite-plus/test";
2
3 import wasmDataUrl from "./vendor/ghostty-vt.wasm?inline";
4 import writePtyWasmDataUrl from "./vendor/ghostty-write-pty.wasm?inline";
5 -import mobileVersion from "../../../../mobile/modules/t3-terminal/Vendor/libghostty-vt/VERSION?raw";
5 +import pinnedVersion from "../../../../../native/libghostty-vt/VERSION?raw";
6 import { ghosttyKeyForCode } from "./keyCodes";
7
8 type WasmFunction = (...args: number[]) => number;
@@ -14,13 +14,13 @@ function decodeWasmDataUrl(dataUrl: string): Uint8Array {
14 }
15
16 describe("vendored libghostty-vt WebAssembly", () => {
17 - it("stays pinned to mobile's canonical revision and size budget", async () => {
17 + it("stays pinned to the canonical revision and size budget", async () => {
18 const wasm = decodeWasmDataUrl(wasmDataUrl);
19 expect(wasm.byteLength).toBeLessThan(750_000);
20
21 // The artifact carries its own provenance: the build embeds the pinned
22 - // revision as semver build metadata, so mobile's VERSION file is the
23 - // single source of truth and drift is caught here without a copy.
22 + // revision as semver build metadata, so the repository's canonical VERSION
23 + // file is the single source of truth and drift is caught here without a copy.
24 const result = await WebAssembly.instantiate(wasm.buffer as ArrayBuffer, {
25 env: { log: () => {} },
26 });
@@ -35,7 +35,7 @@ describe("vendored libghostty-vt WebAssembly", () => {
35 new Uint8Array(memory.buffer, view.getUint32(0, true), view.getUint32(4, true)),
36 );
37 call("ghostty_wasm_free_u8_array", out, 8);
38 - expect(embeddedRevision).toBe(mobileVersion.trim());
38 + expect(embeddedRevision).toBe(pinnedVersion.trim());
39 });
40
41 it("creates, writes multi-codepoint graphemes, and frees repeated terminals", async () => {
docs/architecture/terminal-renderers.md
+1 -1
@@ -12,7 +12,7 @@ boundaries, keyboard encoding, selection, and scrollback:
12 - Android links the native shared library and converts render state into a compact JNI snapshot.
13 - Web loads a separately cached WebAssembly build and reads render state into a Canvas 2D surface.
14 - Both artifacts are built from the revision in
15 - `apps/mobile/modules/t3-terminal/Vendor/libghostty-vt/VERSION`.
15 + `native/libghostty-vt/VERSION`.
16
17 The platform adapters deliberately own only platform behavior. Android owns its Kotlin Canvas and
18 touch integration. Web owns browser font shaping, the hidden IME textarea, clipboard and DOM input,
native/libghostty-vt/LICENSE renamed
native/libghostty-vt/VERSION renamed
native/libghostty-vt/include/ghostty/vt.h renamed
native/libghostty-vt/include/ghostty/vt/allocator.h renamed
native/libghostty-vt/include/ghostty/vt/build_info.h renamed
native/libghostty-vt/include/ghostty/vt/color.h renamed
native/libghostty-vt/include/ghostty/vt/device.h renamed
native/libghostty-vt/include/ghostty/vt/focus.h renamed
native/libghostty-vt/include/ghostty/vt/formatter.h renamed
native/libghostty-vt/include/ghostty/vt/grid_ref.h renamed
native/libghostty-vt/include/ghostty/vt/grid_ref_tracked.h renamed
native/libghostty-vt/include/ghostty/vt/key.h renamed
native/libghostty-vt/include/ghostty/vt/key/encoder.h renamed
native/libghostty-vt/include/ghostty/vt/key/event.h renamed
native/libghostty-vt/include/ghostty/vt/kitty_graphics.h renamed
native/libghostty-vt/include/ghostty/vt/modes.h renamed
native/libghostty-vt/include/ghostty/vt/mouse.h renamed
native/libghostty-vt/include/ghostty/vt/mouse/encoder.h renamed
native/libghostty-vt/include/ghostty/vt/mouse/event.h renamed
native/libghostty-vt/include/ghostty/vt/osc.h renamed
native/libghostty-vt/include/ghostty/vt/paste.h renamed
native/libghostty-vt/include/ghostty/vt/point.h renamed
native/libghostty-vt/include/ghostty/vt/render.h renamed
native/libghostty-vt/include/ghostty/vt/screen.h renamed
native/libghostty-vt/include/ghostty/vt/selection.h renamed
native/libghostty-vt/include/ghostty/vt/sgr.h renamed
native/libghostty-vt/include/ghostty/vt/size_report.h renamed
native/libghostty-vt/include/ghostty/vt/style.h renamed
native/libghostty-vt/include/ghostty/vt/sys.h renamed
native/libghostty-vt/include/ghostty/vt/terminal.h renamed
native/libghostty-vt/include/ghostty/vt/types.h renamed
native/libghostty-vt/include/ghostty/vt/wasm.h renamed