mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
Add title and pwd as both gettable data keys (GHOSTTY_TERMINAL_DATA_TITLE/PWD) and settable options (GHOSTTY_TERMINAL_OPT_TITLE/PWD) in the C terminal API. Getting returns a borrowed GhosttyString; setting copies the data into the terminal via setTitle/setPwd. The underlying Terminal.setTitle/setPwd now append a null sentinel so that getTitle/getPwd can return sentinel-terminated slices ([:0]const u8), which is useful for downstream consumers that need C strings. Change ghostty_terminal_set to return GhosttyResult instead of void so that the new title/pwd options can report allocation failures. Existing option-setting calls cannot fail so the return value is backwards-compatible for callers that discard it.