Commit Graph

17 Commits

Author SHA1 Message Date
Mitchell Hashimoto
dbfc3eb679 Remove unused imports 2025-11-27 13:37:53 -08:00
Qwerasd
6d5b4a3426 perf: replace std.debug.assert with inlined version
See doc comment in `quirks.zig` for reasoning
2025-11-17 12:13:56 -07:00
Mitchell Hashimoto
7d7c0bf5cd lib-vt: Wasm SGR helpers and example (#9362)
This adds some convenience functions for parsing SGR sequences
WebAssembly and adds an example demonstrating SGR parsing in the
browser.
2025-10-26 13:19:55 -07:00
Mitchell Hashimoto
56376a8a38 sgr: make C compat 2025-10-24 11:48:01 -07:00
Mitchell Hashimoto
4d028dac1f terminal: some osc types 2025-10-24 11:17:31 -07:00
Mitchell Hashimoto
0df4d5c5a4 terminal: margins 2025-10-23 20:37:34 -07:00
Mitchell Hashimoto
dc5406781f terminal: many more conversions 2025-10-23 19:56:13 -07:00
Mitchell Hashimoto
099dcbe04d lib: add a TaggedUnion helper to create C ABI compatible tagged unions 2025-10-23 15:50:54 -07:00
Mitchell Hashimoto
c133fac7e7 lib-vt: wasm convenience functions and a simple example (#9309)
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.
2025-10-22 14:25:52 -07:00
Mitchell Hashimoto
9dc2e5978f lib-vt: enable freestanding wasm builds (#9301)
This makes `libghostty-vt` build for freestanding wasm targets (aka a
browser) and produce a `ghostty-vt.wasm` file. This exports the same C
API that libghostty-vt does.

This commit specifically makes the changes necessary for the build to
build properly and for us to run the build in CI. We don't yet actually
try using it...
2025-10-21 20:55:54 -07:00
Mitchell Hashimoto
6a0a94c827 lib: fix holes handling for C 2025-09-27 14:43:01 -07:00
Mitchell Hashimoto
397e47c274 terminal: use LibEnum for the command keys 2025-09-27 14:32:49 -07:00
Mitchell Hashimoto
a79e68ace1 lib: enum func 2025-09-27 14:25:06 -07:00
Mitchell Hashimoto
37372fa50b more docs 2025-09-24 12:45:21 -07:00
Mitchell Hashimoto
43089a01f1 lib: c allocator can use fromZig 2025-09-24 11:00:48 -07:00
Mitchell Hashimoto
2c78ad8889 lib-vt: setup a default allocator if null 2025-09-24 10:30:13 -07:00
Mitchell Hashimoto
969fcfaec3 lib: allocator interface based on Zig allocators 2025-09-24 09:27:17 -07:00