uncurses-ratatui
A ratatui Backend that renders through
uncurses. Write your UI with ratatui widgets and let uncurses
diff frames and ship the minimal bytes. A single UncursesBackend wraps a
Program, which owns input, terminal modes, and the renderer reached through
program().screen().
Usage
Construct the backend and ratatui terminal before session setup. This keeps
restoration available if setup fails. draw() renders widgets, and
backend_mut().read_event() reads input.
use Paragraph;
use ;
Restoration runs after setup, drawing, or input errors. try_restore() reports
restoration errors when the session succeeds.
The backend exposes the wrapped program as program() and program_mut().
Synchronous reads go through Program, so capability replies are observed for
you. try_read_event() returns io::Result<Option<Event>>; use
observe_event only for async streams or events read outside the program.
Setup does not probe the terminal; call
backend.program_mut().query_capabilities(&[])? when you want discovery.
That's the shape of it; the full API and guides live at uncurses.org.
Install
Install v0.0.9 from crates.io:
[]
= "0.0.9"
= "0.0.9"
= "0.30"
Use the v0.0.9 API reference. Checkout examples follow their source revision. Use matching git dependencies for unreleased APIs.
Features mirror the core crate: unicode-rs (default), icu, and runtime-agnostic
async for event_stream() with no tokio dependency.
Credits
Built on ratatui and uncurses, which in turn tips its hat to ncurses, ultraviolet, and colorprofile.
License
MIT. See LICENSE.