escriba_tui/lib.rs
1//! `escriba-tui` — ratatui terminal renderer.
2//!
3//! Third render backend alongside the GPU window (garasu) and the headless
4//! text snapshot. Runs inside any TTY (ghostty, alacritty, iTerm, kitty,
5//! ssh -t, tmux, CI with a pty). Same modal editing, same command palette,
6//! same tatara-lisp config — different presentation layer.
7//!
8//! Architecture:
9//! 1. `run()` enters raw mode, claims the alternate screen.
10//! 2. A `poll_events` loop reads crossterm key events, translates each
11//! into an `escriba_runtime` tick, marks the UI dirty.
12//! 3. On every dirty tick, ratatui redraws the frame — buffer pane +
13//! status line, with Nord-inspired styling.
14//! 4. On quit (Ctrl-C, `:q`, Esc on the top-level), raw mode is released
15//! and the alternate screen restored.
16//!
17//! Same `EditorState` powers all three backends, so behavior is identical;
18//! only the rendering target differs.
19
20extern crate self as escriba_tui;
21
22pub mod keys;
23pub mod render;
24pub mod run;
25
26pub use keys::translate_crossterm_key;
27pub use render::draw_frame;
28pub use run::run;