aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/c/AGENTS.md
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-04-04 19:22:04 +0300
committerCan Celik <ogulcancelik@gmail.com>2026-04-05 01:23:06 +0300
commit41dd733ca7123c9ac4bfc6c781697a660e95b052 (patch)
tree3fc91815ca139ef2e0b281bba0abda4ef15175f4 /vendor/libghostty-vt/src/terminal/c/AGENTS.md
parent55c138263e190a1e79d4b997bfb9397306c0ec1f (diff)
feat: finish ghostty pane backend integration
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/c/AGENTS.md')
-rw-r--r--vendor/libghostty-vt/src/terminal/c/AGENTS.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/terminal/c/AGENTS.md b/vendor/libghostty-vt/src/terminal/c/AGENTS.md
new file mode 100644
index 00000000..63f7fc6c
--- /dev/null
+++ b/vendor/libghostty-vt/src/terminal/c/AGENTS.md
@@ -0,0 +1,22 @@
+# libghostty-vt C API
+
+- C API must be designed with ABI compatibility in mind
+- Zig tagged unions must be converted to C ABI compatible unions
+ via `lib.TaggedUnion`.
+- Any functions must be updated all the way through from here to
+ `src/terminal/c/main.zig` to `src/lib_vt.zig` and the headers
+ in `include/ghostty/vt.h`.
+- In `include/ghostty/vt.h`, always sort the header contents by:
+ (1) macros, (2) forward declarations, (3) types, (4) functions
+
+## ABI Compatibility
+
+- Prefer opaque pointers for long-lived objects, such as
+ `GhosttyTerminal`.
+- Structs:
+ - May contain padding bytes if we're confident we'll never grow
+ beyond a certain size.
+ - May use the "sized struct" pattern: an `extern struct` with
+ `size: usize = @sizeOf(Self)` as the first field. In the C header,
+ callers use `GHOSTTY_INIT_SIZED` from `types.h` to zero-initialize and
+ set the size.