1 //! Termion is a pure Rust, bindless library for low-level handling, manipulating 2 //! and reading information about terminals. This provides a full-featured 3 //! alternative to Termbox. 4 //! 5 //! Termion aims to be simple and yet expressive. It is bindless, meaning that it 6 //! is not a front-end to some other library (e.g., ncurses or termbox), but a 7 //! standalone library directly talking to the TTY. 8 //! 9 //! Supports Redox, Mac OS X, and Linux (or, in general, ANSI terminals). 10 //! 11 //! For more information refer to the [README](https://github.com/redox-os/termion). 12 #![warn(missing_docs)] 13 14 extern crate numtoa; 15 16 #[cfg(target_os = "redox")] 17 #[path="sys/redox/mod.rs"] 18 mod sys; 19 20 #[cfg(all(unix, not(target_os = "redox")))] 21 #[path="sys/unix/mod.rs"] 22 mod sys; 23 24 pub use sys::size::terminal_size; 25 #[cfg(all(unix, not(target_os = "redox")))] 26 pub use sys::size::terminal_size_pixels; 27 pub use sys::tty::{is_tty, get_tty}; 28 29 mod async; 30 pub use async::{AsyncReader, async_stdin}; 31 32 #[macro_use] 33 mod macros; 34 pub mod clear; 35 pub mod color; 36 pub mod cursor; 37 pub mod event; 38 pub mod input; 39 pub mod raw; 40 pub mod screen; 41 pub mod scroll; 42 pub mod style; 43 44 #[cfg(test)] 45 mod test { 46 use super::sys; 47 48 #[test] test_get_terminal_attr()49 fn test_get_terminal_attr() { 50 sys::attr::get_terminal_attr().unwrap(); 51 sys::attr::get_terminal_attr().unwrap(); 52 sys::attr::get_terminal_attr().unwrap(); 53 } 54 55 #[test] test_set_terminal_attr()56 fn test_set_terminal_attr() { 57 let ios = sys::attr::get_terminal_attr().unwrap(); 58 sys::attr::set_terminal_attr(&ios).unwrap(); 59 } 60 61 #[test] test_size()62 fn test_size() { 63 sys::size::terminal_size().unwrap(); 64 } 65 } 66