Skip to Content

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

Highlights

FeatureWhat it does
Inline modeStable UI at the bottom while logs scroll above — no flicker, scrollback preserved.
Deterministic renderingFrame → Buffer → Diff → Presenter → ANSI; no hidden I/O; output is a pure function of state.
One-writer ruleOnly one owner of stdout, enforced by TerminalWriter.
RAII cleanupTerminalSession::Drop restores state even on panic.
80+ widgetsBlock, Table, Input, Tree, Modal, CommandPalette (Bayesian), VirtualizedList (Fenwick + Bayesian heights)…
Pane workspacesDrag-to-resize, magnetic docking, inertial throw, undo/redo/replay timeline.
Web/WASM backendSame Rust core renders in the browser via ftui-web + ftui-showcase-wasm.
Bayesian intelligenceBOCPD, VOI sampling, conformal prediction, e-processes, CUSUM, SOS barriers.
Shadow-run validationProve determinism across runtime migrations by comparing frame checksums.
46 demo screensEach 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.