mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 22:10:29 +00:00
vt: add title_changed effect callback
Add GHOSTTY_TERMINAL_OPT_TITLE_CHANGED so C consumers are notified when the terminal title changes via OSC 0 or OSC 2 sequences. The callback has the same fire-and-forget shape as bell.
This commit is contained in:
@@ -201,6 +201,21 @@ typedef GhosttyString (*GhosttyTerminalEnquiryFn)(GhosttyTerminal terminal,
|
||||
typedef GhosttyString (*GhosttyTerminalXtversionFn)(GhosttyTerminal terminal,
|
||||
void* userdata);
|
||||
|
||||
/**
|
||||
* Callback function type for title_changed.
|
||||
*
|
||||
* Called when the terminal title changes via escape sequences
|
||||
* (e.g. OSC 0 or OSC 2). The new title can be queried from the
|
||||
* terminal after the callback returns.
|
||||
*
|
||||
* @param terminal The terminal handle
|
||||
* @param userdata The userdata pointer set via GHOSTTY_TERMINAL_OPT_USERDATA
|
||||
*
|
||||
* @ingroup terminal
|
||||
*/
|
||||
typedef void (*GhosttyTerminalTitleChangedFn)(GhosttyTerminal terminal,
|
||||
void* userdata);
|
||||
|
||||
/**
|
||||
* Terminal option identifiers.
|
||||
*
|
||||
@@ -249,6 +264,15 @@ typedef enum {
|
||||
* Input type: GhosttyTerminalXtversionFn*
|
||||
*/
|
||||
GHOSTTY_TERMINAL_OPT_XTVERSION = 4,
|
||||
|
||||
/**
|
||||
* Callback invoked when the terminal title changes via escape
|
||||
* sequences (e.g. OSC 0 or OSC 2). Set to NULL to ignore title
|
||||
* change events.
|
||||
*
|
||||
* Input type: GhosttyTerminalTitleChangedFn*
|
||||
*/
|
||||
GHOSTTY_TERMINAL_OPT_TITLE_CHANGED = 5,
|
||||
} GhosttyTerminalOption;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user