Inline Mode
Stable UI at top/bottom while logs scroll above. Preserves scrollback history that other TUI frameworks destroy.
Stitched together from the finest Rust algorithms and brought to life with deterministic math. Runs natively in your terminal and at 60fps in the browser via WASM + WebGPU.
Composable, focused modules
Days from scratch
Alien-artifact quality
fps via WASM + WebGPU
Not another Ratatui wrapper. FrankenTUI is a ground-up TUI kernel with correctness guarantees, deterministic rendering, and algorithms borrowed from statistical machine learning.
Stable UI at top/bottom while logs scroll above. Preserves scrollback history that other TUI frameworks destroy.
Buffer → Diff → Presenter → ANSI pipeline with no hidden I/O. Every frame is reproducible and testable.
TerminalWriter serializes all stdout writes. No cursor corruption, no race conditions, no flicker.
TerminalSession restores terminal state even on panic. Your terminal is never left in a broken state.
12 focused crates: layout, text, style, runtime, widgets. Add only what you need, nothing more.
Bayesian diff strategy, BOCPD resize coalescing, conformal prediction alerts, e-process monitoring. Not heuristics — math.
Compiles to WASM via wasm-pack and renders at 60fps in Chrome/Edge via WebGPU. Same code, same behavior, new platform.
FrankenTUI compiles to WASM and renders via WebGPU at 60fps. Not a DOM-based emulator. Not a terminal.js wrapper. The actual kernel, compiled and running natively.
WebGPU draws directly to a canvas at 60fps. No DOM nodes, no layout thrashing, no reflow penalties. The GPU does the work, not the browser's layout engine.
FrankenTUI in the browser is not an emulator parsing escape sequences — it is the actual TUI kernel compiled to WASM. Widgets, layout, diff, and presenter run natively.
Every frame is a pure function of state. The same model state produces identical pixels in native terminals and in the browser. No race conditions, no flickering.
Rust compiled to WASM uses linear memory with no garbage collector. Frame times are predictable and never interrupted by GC sweeps.
| Feature | FrankenTUI | xterm.js | hterm |
|---|---|---|---|
| Rendering approach | GPU canvas via WebGPU | DOM + canvas renderer | DOM-based |
| Frame rate | 60fps deterministic | Variable (requestAnimationFrame) | Variable (DOM reflow) |
| Input model | Full keyboard/mouse/IME via WASM bridge | Escape sequence parsing | Escape sequence parsing |
| Architecture | Compiled application kernel (Rust → WASM) | Terminal emulator + parser (TypeScript) | Terminal emulator (JavaScript) |
| Update protocol | Flat cell-diff patches (binary) | Escape sequence stream | Escape sequence stream |
| Resize behavior | Instant reflow + re-render (BOCPD coalesced) | Escape sequence + reparse | Escape sequence + reparse |
| Testing model | Deterministic golden checksums | Screenshot diffs | Integration tests |
| Memory model | Rust ownership / RAII (no GC pauses) | JavaScript GC | JavaScript GC |
| Bundle size | ~3.4 MB WASM (includes full app) | ~800 KB JS (emulator only) | ~400 KB JS (emulator only) |
From dashboards to data visualization, file browsers to visual effects. Every screenshot is a real terminal render -- no mocked designs.
FrankenTUI bakes correctness guarantees into the kernel layer. Features that require app-level discipline in other frameworks are enforced by the architecture.
| Feature | Ratatui | tui-rs | Raw crossterm | |
|---|---|---|---|---|
| ✓First-class | ⚠App-specific | ⚠App-specific | ✕Manual | |
| ✓Kernel-level | ⚠Yes | ⚠Yes | ✕No | |
| ✓Enforced | ⚠App-specific | ⚠App-specific | ✕No | |
| ✓TerminalSession | ⚠App-specific | ⚠App-specific | ✕No | |
| ✓Built-in | ✕No | ✕No | ✕No | |
| ✓Built-in | ✕No | ✕No | ✕No | |
| ✓Built-in | ✕No | ✕No | ✕No | |
| Porter-Duff | ✕No | ✕No | ✕No | |
| ✓Built-in | ⚠App-specific | ⚠App-specific | ✕No | |
| ✓Built-in | ✕No | ✕No | ✕No | |
| Enforced (#![forbid]) | Minimized | ✕No | ✕No |
A complete interactive app in under 40 lines. The Elm/Bubbletea-style architecture separates model, update, and view into clean, testable functions.
01 ftui_core::event::Event;02 ftui_core::geometry::Rect;03 ftui_render::frame::Frame;04 ftui_runtime::{App, Cmd, Model, ScreenMode};05 ftui_widgets::paragraph::Paragraph;06 07 TickApp {08 ticks: u64,09}10 11#[(Debug, Clone)]12 Msg {13 Tick,14 Quit,15}16 17 From<Event> Msg {18 from(e: Event) -> Self {19 e {20 Event::Key(k) k.is_char('q') => Msg::Quit,21 _ => Msg::Tick,22 }23 }24}25 26 Model TickApp {27 Message = Msg;28 29 update(& , msg: Msg) -> Cmd<Msg> {30 msg {31 Msg::Tick => {32 .ticks += 1;33 Cmd::none()34 }35 Msg::Quit => Cmd::quit(),36 }37 }38 39 view(&, frame: & Frame) {40 text = format!("Ticks: {} (press 'q' to quit)", .ticks);41 area = Rect::new(0, 0, frame.width(), 1);42 Paragraph::new(text).render(area, frame);43 }44}45 46 main() -> std::io::Result<()> {47 App::new(TickApp { ticks: 0 })48 .screen_mode(ScreenMode::Inline { ui_height: 1 })49 .run()50}100 hours of focused engineering. Every decision documented, every algorithm justified. Here is how the first 3 milestones unfolded.
Initial commit: FrankenTUI plan documents.
Upgraded plan to a hybrid architecture (V5.0 → V6.1).
Expanded the bead graph to cover core components, dependencies, and acceptance tests.
Added a reference library sync script + build infrastructure.
Fixed idempotency and Makefile bugs in the sync tooling.
Seeded beads for syntax highlighting, forms/pickers, and other showcase surfaces.
Initialized the Rust workspace with the `ftui` crate structure.
Added 15 comprehensive feature beads with 46 subtasks.
Added a comprehensive test bead graph for 15 new feature areas.

From the Author
“You need some Alien Artifact code? I know a guy...”
Grok
@gaborcsapo
The Bayesian math and evidence ledger aren't overhead — they're what makes FrankenTUI fast. The Beta posterior avoids scanning unchanged rows (602 Kcells/s sparse). BOCPD collapses resize storms into single renders. VOI keeps overhead under 2%. These are targeted, low-cost models that prevent expensive work.
VIEW_ORIGIN_PROTOCOLAdd FrankenTUI to your Rust project with a single command. Ship terminal interfaces with correctness guarantees from day one.
cargo add ftuiThis entire system was architected and built using the AI Flywheel — an interactive ecosystem of specialized autonomous agents.
“A high-velocity AI engineering ecosystem designed for building systems like FrankenTUI.”
FrankenTUI wasn't built manually. It was architected and implemented through a recursive feedback loop of specialized AI agents, each handling a different layer of the kernel hierarchy.
The development process for FrankenTUI was a recursive feedback loop. Specialized agents handled different layers of the kernel hierarchy, from the zero-unsafe core to the Bayesian diffing strategy.
