Commits
The rgba() function returns signed int32 when alpha >= 128 (bit 31
set). The validator's u32 type rejected these negative values. Add
a color type that accepts the full signed-to-unsigned 32-bit range.
The rgba() function returns signed int32 when alpha >= 128 (bit 31
set). The validator's u32 type rejected these negative values. Add
a color type that accepts the full signed-to-unsigned 32-bit range.
Add CursorEvent with 0-based top/left coords by parsing the terminal's
DSR response (\x1b[row;colR). Rename createTerm's row option to top
so cursor.top feeds directly into createTerm({ top: cursor.top }).
Add a `row` option to TermOptions that offsets all CUP sequences by
the given number of rows, enabling rendering into a region below
existing terminal content rather than always starting at row 1.
Introduce a Setting type that pairs apply/revert escape sequences,
ensuring terminal state is always cleanly restored. Refactor the
keyboard demo to use settings() for alternate buffer, cursor, mouse
tracking, and progressive input.
Clay's pointer hit-testing is now wired through render() via RenderOptions,
returning pointerenter/pointerleave/pointerclick events by diffing
Clay_GetPointerOverIds() across frames. The demo keyboard shows hover
highlights on keys, semantic element IDs, and configurable event log filters.
Correct modifier key codepoint mapping to match the spec (all-lefts-first
57441–57446, then all-rights 57447–57452). Add parser for Kitty-enhanced
legacy CSI sequences (arrows, function keys, tilde-style) that include
`:action` sub-parameters.
Replace CharEvent/KeyEvent with keydown/keyrepeat/keyup discriminated
union. Rewrite the CSI u parser to extract sub-fields: action type
(press/repeat/release), alternate keys (shifted/base), and associated
text codepoints. Legacy terminals emit keydown only; enhanced terminals
add keyrepeat and keyup. Text is populated for printable keys at all
enhancement levels.
Add typedef.ts (ported from clayscript) for declarative C struct
layout computation. Replace hand-written offset constants in
input-native.ts with offsets derived from the struct definition,
eliminating manual offset math while keeping direct DataView
access for V8 performance.
Parse CSI codepoint;modifiers u sequences from terminals that support
the Kitty keyboard protocol (Kitty, Ghostty, WezTerm, iTerm2, etc).
Maps special key codepoints (Tab, Enter, Escape, Backspace, F1-F12,
arrows, etc.) to existing KEY_* constants, and decodes modifier
bitfields to MOD_* flags.
Protocol overview: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
Key encoding: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#key-event-encoding
Functional keys: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#functional-key-definitions
Modifier encoding: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
In setcell(), skip overwriting bg when the incoming value is
ATTR_DEFAULT so that backgrounds painted by render_rect() flow
through to text cells.
Fixes #1
Size memory dynamically based on clayterm_size() instead of hardcoding
256 pages, which was too small for large terminals.
Prevent silent memory corruption with a bounds check in pack() to make
sure we do not pack more operations that can fit in the buffer.
1MB should fit thousands of elements.
Add a complete VT/ANSI terminal input parser that converts VT200/SGR/urxvt
mouse protocols, UTF-8 decoding, and escape sequence into input events
Introduce a `validate` module that uses @sinclair/typebox to
enforce correct op structure and numeric ranges (u8/u16/u32)
before rendering. Exports `validate`, `assert`, and a `validated`
Term wrapper. Adds the `./validate` subpath export.
Use explicit byte-loop implementations instead of __builtin_mem*
to avoid infinite recursion when clang lowers builtins back to
libc calls on some versions.
- Change Term.render() to return Uint8Array instead of string, avoiding
unnecessary TextDecoder overhead on every frame
- Fix Clay element ID collisions by adding a monotonic index to the hash
- Remove cursor hide/show from the C render path (caller responsibility)
- Update README example and tests to match new return type
WASM-based terminal renderer powered by Clay UI layout engine.
Includes command buffer protocol for TS→C communication,
double-buffered ANSI output, and Deno test harness.
The rgba() function returns signed int32 when alpha >= 128 (bit 31
set). The validator's u32 type rejected these negative values. Add
a color type that accepts the full signed-to-unsigned 32-bit range.
Replace CharEvent/KeyEvent with keydown/keyrepeat/keyup discriminated
union. Rewrite the CSI u parser to extract sub-fields: action type
(press/repeat/release), alternate keys (shifted/base), and associated
text codepoints. Legacy terminals emit keydown only; enhanced terminals
add keyrepeat and keyup. Text is populated for printable keys at all
enhancement levels.
Parse CSI codepoint;modifiers u sequences from terminals that support
the Kitty keyboard protocol (Kitty, Ghostty, WezTerm, iTerm2, etc).
Maps special key codepoints (Tab, Enter, Escape, Backspace, F1-F12,
arrows, etc.) to existing KEY_* constants, and decodes modifier
bitfields to MOD_* flags.
Protocol overview: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
Key encoding: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#key-event-encoding
Functional keys: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#functional-key-definitions
Modifier encoding: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
Add a complete VT/ANSI terminal input parser that converts VT200/SGR/urxvt
mouse protocols, UTF-8 decoding, and escape sequence into input events
- Change Term.render() to return Uint8Array instead of string, avoiding
unnecessary TextDecoder overhead on every frame
- Fix Clay element ID collisions by adding a monotonic index to the hash
- Remove cursor hide/show from the C render path (caller responsibility)
- Update README example and tests to match new return type