vt: add setopt_from_terminal to C API

Expose the key encoder Options.fromTerminal function to the C API as
ghostty_key_encoder_setopt_from_terminal. This lets C callers sync all
terminal-derived encoding options (cursor key application mode, keypad
mode, alt escape prefix, modifyOtherKeys, and Kitty flags) in a single
call instead of setting each option individually.
This commit is contained in:
Mitchell Hashimoto
2026-03-15 07:03:44 -07:00
parent c9236558b1
commit 943d3d2e89
6 changed files with 130 additions and 3 deletions

View File

@@ -124,6 +124,7 @@ comptime {
@export(&c.key_encoder_new, .{ .name = "ghostty_key_encoder_new" });
@export(&c.key_encoder_free, .{ .name = "ghostty_key_encoder_free" });
@export(&c.key_encoder_setopt, .{ .name = "ghostty_key_encoder_setopt" });
@export(&c.key_encoder_setopt_from_terminal, .{ .name = "ghostty_key_encoder_setopt_from_terminal" });
@export(&c.key_encoder_encode, .{ .name = "ghostty_key_encoder_encode" });
@export(&c.osc_new, .{ .name = "ghostty_osc_new" });
@export(&c.osc_free, .{ .name = "ghostty_osc_free" });