mirror of
https://github.com/aphrody-labs/opentui.git
synced 2026-10-13 21:08:53 +00:00
The stdin parser gets a group of byte sequences wrong on terminals without the Kitty keyboard protocol. Escape followed by another sequence (a mouse report, a reply, a paste, Alt+key) loses both parts; Alt with punctuation or a non-ASCII character gives a key with an empty name or garbage keys; a wheel release ends a drag; an OSC string cut short by a new sequence swallows it; an unknown CSI sequence becomes an empty-name key; and an X10 report with a 0 byte or a control byte gives wrong coordinates. The fix will land in the native parser port, so this change does not touch the TypeScript parser. It adds the correct behavior as data: `stdin-parser.conformance.json` holds 38 rows of byte steps (with explicit Escape-timeout steps) and the events each must produce, and its `format` field defines the notation and string encoding so a native test can load the same file. The 32 rows that main gets wrong run as `test.todo`; the 6 rows it gets right are normal tests. Every row also runs one byte at a time. `bun test --todo src/lib/stdin-parser.test.ts` fails a todo row that starts to pass, which is how the port shows a fixed row. Existing tests that pin today's behavior are marked so the port knows to flip them. Each todo row fails on main with exactly the wrong output reported in the issue, and breaking the parser six ways (Alt prefix, timer boundary, ESC-less mouse recovery, SGR motion) fails a normal row each time. Refs #1614; the native parser port closes it.
14 lines
367 B
JSON
14 lines
367 B
JSON
{
|
|
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
"semi": false,
|
|
"printWidth": 120,
|
|
"sortPackageJson": false,
|
|
"ignorePatterns": [
|
|
"**/.zig-cache/**",
|
|
"**/zig-pkg/**",
|
|
"packages/core/src/lib/tree-sitter/default-parsers.ts",
|
|
"packages/web/public/recordings/*.json",
|
|
"packages/core/src/lib/stdin-parser.conformance.json"
|
|
]
|
|
}
|