2016-07-02 14:42:18 +01:00
|
|
|
//! Termion is a pure Rust, bindless library for low-level handling, manipulating
|
|
|
|
//! and reading information about terminals. This provides a full-featured
|
|
|
|
//! alternative to Termbox.
|
2016-03-09 08:39:22 +00:00
|
|
|
//!
|
2016-07-02 14:42:18 +01:00
|
|
|
//! Termion aims to be simple and yet expressive. It is bindless, meaning that it
|
|
|
|
//! is not a front-end to some other library (e.g., ncurses or termbox), but a
|
|
|
|
//! standalone library directly talking to the TTY.
|
|
|
|
//!
|
|
|
|
//! Supports Redox, Mac OS X, and Linux (or, in general, ANSI terminals).
|
|
|
|
//!
|
2018-05-07 01:32:39 +01:00
|
|
|
//! For more information refer to the [README](https://github.com/redox-os/termion).
|
2016-03-09 08:39:22 +00:00
|
|
|
#![warn(missing_docs)]
|
|
|
|
|
2018-08-20 23:11:58 +01:00
|
|
|
extern crate numtoa;
|
2021-01-07 12:04:52 +00:00
|
|
|
#[cfg(feature = "serde")]
|
|
|
|
extern crate serde;
|
2018-08-20 23:11:58 +01:00
|
|
|
|
2017-07-23 18:38:21 +01:00
|
|
|
#[cfg(target_os = "redox")]
|
2017-08-01 04:17:47 +01:00
|
|
|
#[path="sys/redox/mod.rs"]
|
|
|
|
mod sys;
|
2017-07-23 18:38:21 +01:00
|
|
|
|
2019-04-21 23:57:34 +01:00
|
|
|
#[cfg(all(unix, not(target_os = "redox")))]
|
2017-08-01 04:17:47 +01:00
|
|
|
#[path="sys/unix/mod.rs"]
|
|
|
|
mod sys;
|
|
|
|
|
|
|
|
pub use sys::size::terminal_size;
|
2019-07-06 19:08:57 +01:00
|
|
|
#[cfg(all(unix, not(target_os = "redox")))]
|
|
|
|
pub use sys::size::terminal_size_pixels;
|
2017-08-01 04:17:47 +01:00
|
|
|
pub use sys::tty::{is_tty, get_tty};
|
2017-07-23 18:38:21 +01:00
|
|
|
|
2021-09-14 21:02:52 +01:00
|
|
|
mod r#async;
|
|
|
|
pub use r#async::{AsyncReader, async_stdin};
|
2016-03-15 19:32:25 +00:00
|
|
|
|
2016-07-23 15:40:27 +01:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
pub mod clear;
|
|
|
|
pub mod color;
|
|
|
|
pub mod cursor;
|
2016-07-23 16:49:52 +01:00
|
|
|
pub mod event;
|
2016-07-23 15:40:27 +01:00
|
|
|
pub mod input;
|
|
|
|
pub mod raw;
|
2017-02-27 12:42:55 +00:00
|
|
|
pub mod screen;
|
2016-07-23 16:49:52 +01:00
|
|
|
pub mod scroll;
|
2016-07-23 15:40:27 +01:00
|
|
|
pub mod style;
|
2017-08-01 04:17:47 +01:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod test {
|
|
|
|
use super::sys;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_get_terminal_attr() {
|
|
|
|
sys::attr::get_terminal_attr().unwrap();
|
|
|
|
sys::attr::get_terminal_attr().unwrap();
|
|
|
|
sys::attr::get_terminal_attr().unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_set_terminal_attr() {
|
|
|
|
let ios = sys::attr::get_terminal_attr().unwrap();
|
|
|
|
sys::attr::set_terminal_attr(&ios).unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_size() {
|
|
|
|
sys::size::terminal_size().unwrap();
|
|
|
|
}
|
|
|
|
}
|