vt: expose cursor_style via terminal_get

Add cursor_style to TerminalData, returning the current SGR style
of the cursor (the style applied to newly printed characters) as a
GhosttyStyle.

Refactor the C style conversion helpers: replace the standalone
convertStyle and convertColor functions with fromStyle and fromColor
initializers on the Style and Color extern structs respectively.
This commit is contained in:
Mitchell Hashimoto
2026-03-19 12:04:56 -07:00
parent 7f36e8bd43
commit d62f6df1d5
3 changed files with 50 additions and 36 deletions

View File

@@ -13,6 +13,7 @@
#include <ghostty/vt/types.h>
#include <ghostty/vt/allocator.h>
#include <ghostty/vt/modes.h>
#include <ghostty/vt/style.h>
#ifdef __cplusplus
extern "C" {
@@ -208,6 +209,15 @@ typedef enum {
* Output type: GhosttyTerminalScrollbar *
*/
GHOSTTY_TERMINAL_DATA_SCROLLBAR = 9,
/**
* The current SGR style of the cursor.
*
* This is the style that will be applied to newly printed characters.
*
* Output type: GhosttyStyle *
*/
GHOSTTY_TERMINAL_DATA_CURSOR_STYLE = 10,
} GhosttyTerminalData;
/**