mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-18 21:40:29 +00:00
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.
This commit is contained in:
committed by
GitHub
parent
9dc2e5978f
commit
c133fac7e7
@@ -77,7 +77,7 @@ pub fn encode(
|
||||
event: key.KeyEvent,
|
||||
opts: Options,
|
||||
) std.Io.Writer.Error!void {
|
||||
//std.log.warn("KEYENCODER event={} opts={}", .{ event, opts });
|
||||
std.log.warn("KEYENCODER event={} opts={}", .{ event, opts });
|
||||
return if (opts.kitty_flags.int() != 0) try kitty(
|
||||
writer,
|
||||
event,
|
||||
|
||||
Reference in New Issue
Block a user