Repository navigation
Releases
Releases · vercel-labs/tui
v0.2.1
Fixes
- Apps: the app object from
runApphasdone(), a promise that settles with the app's exit code when it stops:0forstop(), the code given toexit(), or130for an unhandled Ctrl+C. Awaiting it lets an unhandled Ctrl+C stop the app and return control to the caller instead of exiting the process. - Input: a bracketed paste whose end marker is split across reads now ends correctly, so keys typed after the paste are not read as pasted text.
- Markdown: quotes and lists nest up to 16 levels. Deeper input is laid out as text instead of exhausting the stack.
- Testing:
press("space")sends the key a terminal sends for Space:name: "char",text: " ", andbase: "space". - Text:
wrap("")returns no lines. Text made only of line breaks keeps its empty lines. - Textarea: typing at the start of text that begins with a line break inserts the character before it.
Contributors
v0.2.0
The first release of tui, a TypeScript library for fast terminal apps that compile to native executables with scriptc. tui is experimental, and its API will change before 1.0.
New Features
- Apps:
runAppruns an app from aviewfunction that draws the whole screen from your state. tui handles keys, paste, the mouse, Unicode widths, and screen diffing. - Components:
Listbox,CheckboxGroup,Tabs,Table,Input,Textarea,Dialog, andScrollArea, drawn every frame from your state.definePrimitivebuilds your own on the same state, focus, and change contract. - Native executables: the same file runs on Node.js 24 or later and compiles with scriptc to one native executable that starts in about 2 ms, up to 80x faster to the first frame than Node.js, in about 20x less memory.
- Agents and tests:
tui/agentis an MCP server that lets an agent read and act on a running app withsnapshotandact.createTestAppruns an app with no terminal, so a test presses keys, types, clicks, and reads the screen back. - Prompts:
tui/promptasks text, select, multiselect, confirm, spinner, and progress questions below the cursor. - Drawing: Markdown laid out to a width, canvases, braille dots, shaders, charts, images, meters, and sparklines, with
split,inset, andcenterfor layout. - Motion and long lists: springs, transitions, and easings over the next frames, and
createFilterfor matching lines in a long list. - Text:
widthOf,wrap, andtruncatewith Unicode 17 widths.