feat(inspector): replace xterm.js with ghostty-web

- Replace @xterm/xterm, @xterm/addon-fit, and @xterm/addon-web-links with ghostty-web
- Update Terminal component to use ghostty-web API:
  - Add async WASM initialization via init()
  - Use FitAddon with observeResize() for auto-fitting
  - Use onResize callback for terminal resize events
- ghostty-web is API-compatible with xterm.js but uses Ghostty's WASM-compiled VT100 parser
- Benefits:
  - Better rendering of complex scripts (Devanagari, Arabic)
  - XTPUSHSGR/XTPOPSGR support
  - Same battle-tested code as native Ghostty app

Ref: https://github.com/coder/ghostty-web
This commit is contained in:
Nathan Flurry 2026-01-30 13:26:09 -08:00
parent ac0a22cd07
commit 1d1069d6fb
3 changed files with 128 additions and 110 deletions

8
pnpm-lock.yaml generated
View file

@ -99,6 +99,9 @@ importers:
frontend/packages/inspector:
dependencies:
ghostty-web:
specifier: ^0.3.0
version: 0.3.0
lucide-react:
specifier: ^0.469.0
version: 0.469.0(react@18.3.1)
@ -2572,6 +2575,9 @@ packages:
get-tsconfig@4.13.0:
resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==}
ghostty-web@0.3.0:
resolution: {integrity: sha512-SAdSHWYF20GMZUB0n8kh1N6Z4ljMnuUqT8iTB2n5FAPswEV10MejEpLlhW/769GL5+BQa1NYwEg9y/XCckV5+A==}
github-slugger@2.0.0:
resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==}
@ -6787,6 +6793,8 @@ snapshots:
dependencies:
resolve-pkg-maps: 1.0.0
ghostty-web@0.3.0: {}
github-slugger@2.0.0: {}
glob-parent@5.1.2: