feat: terminfo capability core (struct, parser, queryTermInfo)
Implements the terminfo-spec capability core:
- src/terminfo.{c,h}: the TermInfo capability struct (generation,
colors, flags, confirmed, theme group), the xterm-256color baseline
init, and terminfo_parse for both storage formats (legacy 0432 and
extended-number 01036) including the extended capability table
(RGB/Tc/Su/Smulx). Parsing is bounds-checked everywhere and
all-or-nothing: malformed input returns a nonzero code without
touching the struct (TINV-3). A successful parse replaces the
standard capabilities the entry owns — absent booleans clear, colors
becomes the entry's max_colors — matching ncurses semantics where an
entry fully describes its terminal. terminfo_grant applies
creation-time evidence (COLORTERM) and bumps the generation only on
actual change.
- terminfo.ts: queryTermInfo() as the single blessed entry point.
Locates entries via the ncurses search path (TERMINFO, ~/.terminfo,
TERMINFO_DIRS, compiled-in defaults; letter and hex directory
layouts; traversal-safe, magic-validated — ported from the
bombshell-dev/ui feat/terminfo spike), parses into a fresh shared
WebAssembly.Memory with a bump allocator (the renderer and input
parser will attach to the same memory in follow-ups), applies
COLORTERM evidence, and runs the sans-IO probe batch (OSC 10/11/12,
kitty OSC 21/22, XTGETTCAP RGB;Tc, DECRQM 2026, kitty keyboard and
graphics, DA1 fence) over injectable streams. It never rejects on
environmental grounds: missing entries, non-TTY streams, timeouts,
and aborts all resolve with whatever evidence was gathered. Raw mode
is saved and restored around the probe window.
- test/terminfo.test.ts + embedded fixtures (tasks/gen-fixtures.ts):
real xterm-256color, tic-compiled extended-caps entry, hand-built
01036 entry (macOS ships ncurses 6.0, which predates that format),
16-color downgrade entry. The extended-block layout (name offsets
relative to the names sub-table) was verified against tic output
byte-by-byte.
The probe window currently closes on timeout only; DA1 fence
recognition lands with the input parser integration.
feat: terminfo capability core (struct, parser, queryTermInfo)
Implements the terminfo-spec capability core:
- src/terminfo.{c,h}: the TermInfo capability struct (generation,
colors, flags, confirmed, theme group), the xterm-256color baseline
init, and terminfo_parse for both storage formats (legacy 0432 and
extended-number 01036) including the extended capability table
(RGB/Tc/Su/Smulx). Parsing is bounds-checked everywhere and
all-or-nothing: malformed input returns a nonzero code without
touching the struct (TINV-3). A successful parse replaces the
standard capabilities the entry owns — absent booleans clear, colors
becomes the entry's max_colors — matching ncurses semantics where an
entry fully describes its terminal. terminfo_grant applies
creation-time evidence (COLORTERM) and bumps the generation only on
actual change.
- terminfo.ts: queryTermInfo() as the single blessed entry point.
Locates entries via the ncurses search path (TERMINFO, ~/.terminfo,
TERMINFO_DIRS, compiled-in defaults; letter and hex directory
layouts; traversal-safe, magic-validated — ported from the
bombshell-dev/ui feat/terminfo spike), parses into a fresh shared
WebAssembly.Memory with a bump allocator (the renderer and input
parser will attach to the same memory in follow-ups), applies
COLORTERM evidence, and runs the sans-IO probe batch (OSC 10/11/12,
kitty OSC 21/22, XTGETTCAP RGB;Tc, DECRQM 2026, kitty keyboard and
graphics, DA1 fence) over injectable streams. It never rejects on
environmental grounds: missing entries, non-TTY streams, timeouts,
and aborts all resolve with whatever evidence was gathered. Raw mode
is saved and restored around the probe window.
- test/terminfo.test.ts + embedded fixtures (tasks/gen-fixtures.ts):
real xterm-256color, tic-compiled extended-caps entry, hand-built
01036 entry (macOS ships ncurses 6.0, which predates that format),
16-color downgrade entry. The extended-block layout (name offsets
relative to the names sub-table) was verified against tic output
byte-by-byte.
The probe window currently closes on timeout only; DA1 fence
recognition lands with the input parser integration.