spec: add terminfo & capability layer specification - #130
Open
natemoo-re wants to merge 1 commit into
Open
natemoo-re wants to merge 1 commit into
natemoo-re wants to merge 1 commit into
Conversation
No changeset neededThis pull request is classified as no_release_impact: no published package |
natemoo-re
added this pull request to stack #134
September 19, 2026 04:29
commit: |
This was referenced Sep 19, 2026
Closed
natemoo-re
marked this pull request as ready for review
September 19, 2026 04:33
cowboyd
reviewed
Sep 28, 2026
Comment on lines
+257
to
+264
| | `foreground-color` | OSC 10 | [`osc-10-fg-color-query`](https://terminfo.dev) | | ||
| | `background-color` | OSC 11 | [`osc-11-bg-color-query`](https://terminfo.dev) | | ||
| | `cursor-color` | OSC 12 or OSC 21 | [`osc-12-cursor-color`](https://terminfo.dev) | | ||
| | `colordepth` | XTGETTCAP `RGB`/`Tc` | [`24-bit-truecolor`](https://terminfo.dev) | | ||
| | `sync-output` | DECRPM mode 2026 | [`decset-2026-synchronized-output`](https://terminfo.dev) | | ||
| | `kitty-keyboard` | `CSI ? u` | [`kitty-keyboard-protocol`](https://terminfo.dev) | | ||
| | `kitty-graphics` | APC `_G…` | [`kitty-graphics-protocol`](https://terminfo.dev) | | ||
| | `pointer-shape` | OSC 22 | [`osc-22-pointer-shape`](https://terminfo.dev) | |
Collaborator
There was a problem hiding this comment.
Looks like these urls are incomplete? they only appear to reference the base domain?
Comment on lines
+349
to
+350
| `terminfo_parse(bytes, len, out)` accepts a compiled terminfo entry and | ||
| populates a `Capabilities`-shaped struct. |
Collaborator
There was a problem hiding this comment.
Is this a C function? how are errors represented?
Comment on lines
+488
to
+505
| ### 10.4 `applyUpdate` | ||
|
|
||
| ```ts | ||
| function applyUpdate( | ||
| current: RuntimeCapabilities, | ||
| change: Update, | ||
| ): { readonly next: RuntimeCapabilities; readonly bytes: Uint8Array }; | ||
|
|
||
| type Update = | ||
| | { width: number; height: number } | ||
| | CapabilityEvent; | ||
| ``` | ||
|
|
||
| `applyUpdate` is a pure function. Given the current `RuntimeCapabilities` and | ||
| one `Update`, it returns the next `RuntimeCapabilities` and any bytes defined by | ||
| the consuming feature. The foundation returns an empty byte array; | ||
| `term.update()` is a loop over `applyUpdate`. Exporting the reducer allows tests | ||
| to assert `(next, bytes)` against literal values without a live `Term`. |
Collaborator
There was a problem hiding this comment.
Is it worth externalizing this logic in the specs just to be able to write internal unit tests? Isn't creating a term pretty lightweight given that it does not actually do any I/O (aside from loading the WASM once?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part 1/4 of the terminfo foundation stack (supersedes the mixed-history #106, which will be closed once this stack lands). Tracks the spec only — implementation PRs are stacked as drafts and must not merge before this spec is approved, per the spec-driven workflow.
What this adds
specs/terminfo-spec.md(new, normative): the capability layer —Capabilities,Detection, theCapabilityEventunion, the probe model (query batch + DA1 completion fence, sans-IO), compiled terminfo binary parsing (legacy + extended), the baseline capability set, and the progressive-enhancement evidence model.specs/renderer-spec.md: §7.7 update transaction generalized to resize or capability updates; §7.8 defines capability consumption as deliberately deferred — no renderer output changes in this stack; §8.6 specifies theterm.update()public API.specs/input-spec.md: §6 probe-response recognition (how query responses are recognized byte-by-byte and surfaced as events).specs/transitions-spec.md: removes a stale cross-reference note.Review guidance
The spec is the reviewable artifact here; the stacked implementation PRs (#131, #132, #133) conform to it mechanically. Renderer byte output is unchanged across the entire stack — the first gated consumer (color encoding, #60) is a follow-up and deliberately out of scope (§7.8).
Follow-up protocol work is tracked in #129.