[][src]Crate mortal

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.

Concurrency

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.

Re-exports

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;

Modules

screen

Provides a drawable buffer on terminal devices

sequence

Utilities for manipulating raw input sequences

signal

Contains types relating to operating system signals

terminal

Provides an interface to terminal devices

unix

Unix extension trait

util

Miscellaneous utility functions

Macros

term_write

Writes attributes and formatted text to a Terminal or Screen.

term_writeln

Writes attributes and formatted text to a Terminal or Screen.