mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
Add a typed option setter ghostty_terminal_set() following the existing setopt pattern used by the key encoder and render state APIs. This is the first step toward exposing stream_terminal Handler.Effects through the C API. The initial implementation includes a write_pty callback and a shared userdata pointer. The write_pty callback is invoked synchronously during ghostty_terminal_vt_write() when the terminal needs to send a response back to the pty, such as DECRQM mode reports or device status responses. Trampolines are always installed at terminal creation time and no-op when no C callback is set, so callers can configure callbacks at any point without reinitializing the stream. The C callback state is grouped into an internal Effects struct on the TerminalWrapper to simplify adding more callbacks in the future.