vt: align SGR C enum tags with parser output (#11239)

Remove the stale GHOSTTY_SGR_ATTR_RESET_UNDERLINE entry from the C
header and renumber subsequent GhosttySgrAttributeTag values to match
src/terminal/sgr.zig Attribute.Tag ordering.

This fixes misclassified attributes from ghostty_sgr_next for C
consumers that switch on the enum tags from include/ghostty/vt/sgr.h.
This commit is contained in:
Mitchell Hashimoto
2026-03-08 13:01:44 -07:00
committed by GitHub

View File

@@ -109,30 +109,29 @@ typedef enum {
GHOSTTY_SGR_ATTR_RESET_ITALIC = 5,
GHOSTTY_SGR_ATTR_FAINT = 6,
GHOSTTY_SGR_ATTR_UNDERLINE = 7,
GHOSTTY_SGR_ATTR_RESET_UNDERLINE = 8,
GHOSTTY_SGR_ATTR_UNDERLINE_COLOR = 9,
GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256 = 10,
GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR = 11,
GHOSTTY_SGR_ATTR_OVERLINE = 12,
GHOSTTY_SGR_ATTR_RESET_OVERLINE = 13,
GHOSTTY_SGR_ATTR_BLINK = 14,
GHOSTTY_SGR_ATTR_RESET_BLINK = 15,
GHOSTTY_SGR_ATTR_INVERSE = 16,
GHOSTTY_SGR_ATTR_RESET_INVERSE = 17,
GHOSTTY_SGR_ATTR_INVISIBLE = 18,
GHOSTTY_SGR_ATTR_RESET_INVISIBLE = 19,
GHOSTTY_SGR_ATTR_STRIKETHROUGH = 20,
GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH = 21,
GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG = 22,
GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG = 23,
GHOSTTY_SGR_ATTR_BG_8 = 24,
GHOSTTY_SGR_ATTR_FG_8 = 25,
GHOSTTY_SGR_ATTR_RESET_FG = 26,
GHOSTTY_SGR_ATTR_RESET_BG = 27,
GHOSTTY_SGR_ATTR_BRIGHT_BG_8 = 28,
GHOSTTY_SGR_ATTR_BRIGHT_FG_8 = 29,
GHOSTTY_SGR_ATTR_BG_256 = 30,
GHOSTTY_SGR_ATTR_FG_256 = 31,
GHOSTTY_SGR_ATTR_UNDERLINE_COLOR = 8,
GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256 = 9,
GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR = 10,
GHOSTTY_SGR_ATTR_OVERLINE = 11,
GHOSTTY_SGR_ATTR_RESET_OVERLINE = 12,
GHOSTTY_SGR_ATTR_BLINK = 13,
GHOSTTY_SGR_ATTR_RESET_BLINK = 14,
GHOSTTY_SGR_ATTR_INVERSE = 15,
GHOSTTY_SGR_ATTR_RESET_INVERSE = 16,
GHOSTTY_SGR_ATTR_INVISIBLE = 17,
GHOSTTY_SGR_ATTR_RESET_INVISIBLE = 18,
GHOSTTY_SGR_ATTR_STRIKETHROUGH = 19,
GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH = 20,
GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG = 21,
GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG = 22,
GHOSTTY_SGR_ATTR_BG_8 = 23,
GHOSTTY_SGR_ATTR_FG_8 = 24,
GHOSTTY_SGR_ATTR_RESET_FG = 25,
GHOSTTY_SGR_ATTR_RESET_BG = 26,
GHOSTTY_SGR_ATTR_BRIGHT_BG_8 = 27,
GHOSTTY_SGR_ATTR_BRIGHT_FG_8 = 28,
GHOSTTY_SGR_ATTR_BG_256 = 29,
GHOSTTY_SGR_ATTR_FG_256 = 30,
} GhosttySgrAttributeTag;
/**