mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-30 08:45:23 +00:00
Add focus event encoding (CSI I / CSI O) to the libghostty-vt public API, following the same patterns as key and mouse encoding. The focus Event enum uses lib.Enum for C ABI compatibility. The C API provides ghostty_focus_encode() which writes into a caller-provided buffer and returns GHOSTTY_OUT_OF_SPACE with the required size when the buffer is too small. Also update key and mouse encoders to return GHOSTTY_OUT_OF_SPACE instead of GHOSTTY_OUT_OF_MEMORY for buffer-too-small errors, reserving OUT_OF_MEMORY for actual allocation failures. Update all corresponding header documentation.