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.1.11"
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::{
23//!     style::{Color, Modifier, Style},
24//!     widgets::{Block, Borders},
25//! };
26//! use tui_term::widget::PseudoTerminal;
27//! use vt100::Parser;
28//!
29//! let mut parser = vt100::Parser::new(24, 80, 0);
30//! let pseudo_term = PseudoTerminal::new(parser.screen())
31//!     .block(Block::default().title("Terminal").borders(Borders::ALL))
32//!     .style(
33//!         Style::default()
34//!             .fg(Color::White)
35//!             .bg(Color::Black)
36//!             .add_modifier(Modifier::BOLD),
37//!     );
38//! ```
39//!
40//! For more examples, please look at the [examples](https://github.com/a-kenji/tui-term/tree/main/examples) in the repository.
41//!
42//! # Features
43//!
44//! - Support for parsing and processing terminal control sequences using the `vt100` crate.
45//!
46//! # Limitations
47//!
48//! - The `vt100` crate is currently the only supported backend for parsing terminal control
49//!   sequences, but future versions may introduce support for alternative backends.
50
51mod state;
52#[cfg(feature = "vt100")]
53mod vt100_imp;
54pub mod widget;
55
56#[cfg(feature = "unstable")]
57pub mod controller;
58
59/// Reexport of the vt100 crate to ensure correct version compatibility
60#[cfg(feature = "vt100")]
61pub use vt100;