tui_term/
lib.rs

1//! `tui-term` is a library that provides pseudoterminal widget functionality for building
2//! interactive terminal applications using `ratatui`.
3//!
4//! # Installation
5//!
6//! To use the `tui-term` library, add it as a dependency in your `Cargo.toml` file:
7//!
8//! ```toml
9//! [dependencies]
10//! tui-term = "0.2.0"
11//! ```
12//!
13//! or use `cargo add`:
14//!
15//! ```test
16//! cargo add tui-term
17//! ```
18//!
19//! # Examples
20//!
21//! ```rust
22//! use ratatui_core::style::{Color, Modifier, Style};
23//! use ratatui_widgets::{block::Block, borders::Borders};
24//! use tui_term::widget::PseudoTerminal;
25//! use vt100::Parser;
26//!
27//! let mut parser = vt100::Parser::new(24, 80, 0);
28//! let pseudo_term = PseudoTerminal::new(parser.screen())
29//!     .block(Block::default().title("Terminal").borders(Borders::ALL))
30//!     .style(
31//!         Style::default()
32//!             .fg(Color::White)
33//!             .bg(Color::Black)
34//!             .add_modifier(Modifier::BOLD),
35//!     );
36//! ```
37//!
38//! For more examples, please look at the [examples](https://github.com/a-kenji/tui-term/tree/release/examples) in the repository.
39//!
40//! # Features
41//!
42//! - Support for parsing and processing terminal control sequences using the `vt100` crate.
43//!
44//! # Limitations
45//!
46//! - The `vt100` crate is currently the only supported backend for parsing terminal control
47//!   sequences, but future versions may introduce support for alternative backends.
48
49#![warn(clippy::std_instead_of_core)]
50#![warn(clippy::std_instead_of_alloc)]
51#![warn(clippy::alloc_instead_of_core)]
52
53mod state;
54#[cfg(feature = "vt100")]
55mod vt100_imp;
56pub mod widget;
57
58#[cfg(feature = "unstable")]
59pub mod controller;
60
61/// Reexport of the vt100 crate to ensure correct version compatibility
62#[cfg(feature = "vt100")]
63pub use vt100;