Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: terminfo #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
feat: terminfo #106
Changes from 1 commit
9de9847255d57300fbfb2c418e1cd3e10c5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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.Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.