FrankenTUI
A minimal, high-performance terminal UI kernel. 850K+ lines of Rust across 20 crates, 80+ widget implementations, 46 interactive demo screens, a full pane workspace system, in-tree web/WASM backends, and a Bayesian intelligence layer that replaces heuristics with principled statistics.
The primary way to see what FrankenTUI does is to run the demo showcase:
cargo run -p ftui-demo-showcase. Installation takes under a minute once you
have Rust nightly.
The problem
Most TUI stacks make it easy to draw widgets, but hard to build correct, flicker-free, inline UIs with strict terminal cleanup and deterministic rendering. Typical failure modes:
- A crash leaves the terminal in raw mode — the user has to
reset. - A window resize during a drag glitches the screen because resize events flood.
- Inline UIs stomp on scrollback, or scrollback stomps on the UI.
- “Flicker” from partial frame writes.
- Ad-hoc threshold tuning that works on the dev’s laptop and nowhere else.
The solution
A kernel with a disciplined runtime, a diff-based renderer, and three inline-mode
strategies selected automatically per terminal. Every probabilistic decision is
computed from a Bayesian posterior and logged to an evidence ledger. Terminal
cleanup is RAII. Output flows through exactly one writer. The rendering pipeline
is Frame → Buffer → BufferDiff → Presenter → ANSI, with no hidden I/O.
Where to start
The design philosophy and what makes it different from Ratatui or raw crossterm.
What is FrankenTUI?Run the 46-screen showcase in under a minute.
Quick runA minimal working model walked through line-by-line.
Hello, tickThe four-layer pipeline: Input → Runtime → Render → Output.
ArchitectureAll 46 screens, each demonstrating a subsystem.
Demo showcaseWhy every threshold is a Bayesian posterior.
Intelligence layerHighlights
| Feature | What it does |
|---|---|
| Inline mode | Stable UI at the bottom while logs scroll above — no flicker, scrollback preserved. |
| Deterministic rendering | Frame → Buffer → Diff → Presenter → ANSI; no hidden I/O; output is a pure function of state. |
| One-writer rule | Only one owner of stdout, enforced by TerminalWriter. |
| RAII cleanup | TerminalSession::Drop restores state even on panic. |
| 80+ widgets | Block, Table, Input, Tree, Modal, CommandPalette (Bayesian), VirtualizedList (Fenwick + Bayesian heights)… |
| Pane workspaces | Drag-to-resize, magnetic docking, inertial throw, undo/redo/replay timeline. |
| Web/WASM backend | Same Rust core renders in the browser via ftui-web + ftui-showcase-wasm. |
| Bayesian intelligence | BOCPD, VOI sampling, conformal prediction, e-processes, CUSUM, SOS barriers. |
| Shadow-run validation | Prove determinism across runtime migrations by comparing frame checksums. |
| 46 demo screens | Each screen is also a snapshot test target. |
Status at a glance
Work in progress. APIs evolve quickly. Three of 20 crates are on crates.io
(ftui-core, ftui-layout, ftui-i18n); the rest are in the publish queue.
Use workspace path dependencies for the full stack.
See the workspace layout for a per-crate status table, and the runtime migration guide for the three execution lanes (Legacy / Structured / Asupersync).
License & contributions
MIT with OpenAI/Anthropic rider, © 2026 Jeffrey Emanuel.
The project does not accept outside PR merges — see the project philosophy page. Bug reports are welcome.