mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-28 17:14:39 +00:00
This adds a set of Wasm convenience functions to ease memory management. These are all prefixed with `ghostty_wasm` and are documented as part of the standard Doxygen docs. I also added a very simple single-page HTML example that demonstrates how to use the Wasm module for key encoding. This also adds a bunch of safety checks to the C API to verify that valid values are actually passed to the function. This is an easy to hit bug. **AI disclosure:** The example is AI-written with Amp. I read through all the code and understand it but I can't claim there isn't a better way, I'm far from a JS expert. It is simple and works currently though. Happy to see improvements if anyone wants to contribute.
933 B
933 B
Agent Development Guide
A file for guiding coding agents.
Commands
- Build:
zig build - Test (Zig):
zig build test - Test filter (Zig):
zig build test -Dtest-filter=<test name> - Formatting (Zig):
zig fmt . - Formatting (other):
prettier -w .
Directory Structure
- Shared Zig core:
src/ - C API:
include - macOS app:
macos/ - GTK (Linux and FreeBSD) app:
src/apprt/gtk
libghostty-vt
- Build:
zig build lib-vt - Build Wasm Module:
zig build lib-vt -Dtarget=wasm32-freestanding - Test:
zig build test-lib-vt - Test filter:
zig build test-lib-vt -Dtest-filter=<test name> - When working on libghostty-vt, do not build the full app.
- For C only changes, don't run the Zig tests. Build all the examples.
macOS App
- Do not use
xcodebuild - Use
zig buildto build the macOS app and any shared Zig code - Run Xcode tests using
zig build test