Expand description

Platform-independent terminal interface

Two distinct interfaces to operating system terminal devices are provided, each abstracting over the differences between Unix terminals and Windows console.

The Terminal interface treats the terminal as a line-by-line output device. Methods exist to add color and style attributes to text, and to make relative movements of the cursor.

The Screen interface treats the entire terminal window as a drawable buffer. Methods exist to set the cursor position and to write text with color and style attributes.

The term_write! and term_writeln! macros provide a convenient interface to output attributes and formatted text to either a Terminal or Screen instance.


Each interface uses internal locking mechanisms to allow sharing of the terminal interface between threads while maintaining coherence of read/write operations.

See the documentation for Terminal and Screen for further details.


pub use crate::screen::Screen;
pub use crate::screen::ScreenReadGuard;
pub use crate::screen::ScreenWriteGuard;
pub use crate::sequence::FindResult;
pub use crate::sequence::SequenceMap;
pub use crate::signal::Signal;
pub use crate::signal::SignalSet;
pub use crate::terminal::Color;
pub use crate::terminal::Cursor;
pub use crate::terminal::CursorMode;
pub use crate::terminal::Size;
pub use crate::terminal::Style;
pub use crate::terminal::Theme;
pub use crate::terminal::Event;
pub use crate::terminal::Key;
pub use crate::terminal::MouseEvent;
pub use crate::terminal::MouseInput;
pub use crate::terminal::MouseButton;
pub use crate::terminal::ModifierState;
pub use crate::terminal::PrepareConfig;
pub use crate::terminal::PrepareState;
pub use crate::terminal::Terminal;
pub use crate::terminal::TerminalReadGuard;
pub use crate::terminal::TerminalWriteGuard;


Provides a drawable buffer on terminal devices

Utilities for manipulating raw input sequences

Contains types relating to operating system signals

Provides an interface to terminal devices

Unix extension trait

Miscellaneous utility functions


Writes attributes and formatted text to a Terminal or Screen.

Writes attributes and formatted text to a Terminal or Screen.