feat: input parser probe-response recognition → CapabilityEvent - #132
Draft
natemoo-re wants to merge 2 commits into
Draft
natemoo-re wants to merge 2 commits into
natemoo-re wants to merge 2 commits into
Conversation
natemoo-re
added this pull request to stack #134
September 19, 2026 04:29
Changeset suggestionThis PR changes published packages but has no changeset. View the proposed changeset---
---
Adds `CapabilityEvent` to `InputEvent` and a `detection` option to `createInputOptions`.
`scan()` now parses terminal probe responses — OSC 10/11/12 (theme colors), OSC 21 (kitty color protocol), OSC 22 (pointer shape), DCS XTGETTCAP replies (color depth), APC kitty graphics replies, CSI `?…u` kitty keyboard flags, and DECRPM (`$y`) synchronized output — and surfaces them as typed `CapabilityEvent` objects with strongly-typed `key`/`value` pairs.
Pass a `Detection` from `detectTerminal()` to seed the key trie with terminal-specific sequences and calibrate color-depth denial events; omit it to keep the existing xterm-default behavior.
#### Migration
`InputOptions.terminfo` is replaced by `InputOptions.detection`:
```diff
- import { createInput } from "@bombshell/input";
+ import { createInput } from "@bombshell/input";
+ import { detectTerminal } from "@bombshell/input/terminfo";
- const input = await createInput({ terminfo: myTerminfoBinary });
+ const detection = await detectTerminal();
+ const input = await createInput({ detection });
```
If you were not passing `terminfo`, no change is needed.If this draft is correct, react with 🚀 and Cooper will commit it to this branch. |
commit: |
|
Size Increased — +15.2 KB 118.0 KB unpacked |
This was referenced Sep 19, 2026
Contributor
Merging this PR will degrade performance by 24.19%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes |
natemoo-re
force-pushed
the
feat/input-probe-events
branch
from
September 30, 2026 01:50
ff3f7c4 to
299df82
Compare
natemoo-re
force-pushed
the
feat/input-probe-events
branch
from
September 30, 2026 02:01
299df82 to
74c6281
Compare
natemoo-re
force-pushed
the
feat/input-probe-events
branch
from
September 30, 2026 02:03
74c6281 to
4b430b6
Compare
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 3/4 of the terminfo foundation stack. Requires #131; draft until the spec (#130) is approved.
What this adds
src/input.{c,h}: the input parser seeds its escape-sequence trie from the terminfokeystable and recognizes probe responses — OSC 10/11/12/21/22, XTGETTCAP, DECRPM (mode 2026), kitty keyboard/graphics APC, and the DA1 completion fence — emitting typed capability records alongside key/mouse events.input-native.ts/input.ts:createInput({ detection })wires the detection in;scan()surfaces probe responses asCapabilityEventvalues interleaved with key and mouse events, ready to route toterm.update().test/input.test.ts(+test/caps.tshelpers): response recognition per input-spec §6.Breaking change
InputOptions.terminfo(raw compiled bytes) is replaced byInputOptions.detection, per terminfo-spec §2. Covered by the changeset on the final PR of the stack.