Commit 9626fbd
authored
refactor implementation to use more ghostty (#12)
* Phase 2: Replace TypeScript VT parser/buffer with WASM terminal
- Added GhosttyTerminal class (311 lines) wrapping WASM terminal emulator
- Created TerminalAdapter to bridge WASM cells to renderer format
- Updated Terminal class to use WASM backend instead of ScreenBuffer + VTParser
- Made CanvasRenderer duck-typed with IRenderable interface
- Deleted lib/buffer.ts (840 lines) and lib/vt-parser.ts (635 lines)
- Created lib/buffer-types.ts (29 lines) for minimal type compatibility
- Updated WASM binary to 404 KB (includes terminal exports)
- All 86 tests passing
- Net: -1,475 lines (-33% codebase reduction)
Benefits:
- Production-tested VT100 emulation from Ghostty
- Simplified codebase (1,475 fewer lines to maintain)
- Maintained xterm.js-compatible API
- All existing tests pass without modification
* Update WASM binary with width bug fix
- Cells now have correct width values (1 for normal, 2 for wide, 0 for spacers)
- Fixes rendering issue where characters were not visible
- Updated from phase1 commit 811a60d601 parent b21c6a3 commit 9626fbd
13 files changed
Lines changed: 622 additions & 3167 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments