minicrossterm/crossterm_screen/examples/raw_mode.rs
Timon 1e332daaed
Refactor and API stabilization (#115)
- Major refactor and cleanup.
- Improved performance; 
    - No locking when writing to stdout. 
    - UNIX doesn't have any dynamic dispatch anymore. 
    - Windows has improved the way to check if ANSI modes are enabled.
    - Removed lot's of complex API calls: `from_screen`, `from_output`
    - Removed `Arc<TerminalOutput>` from all internal Api's. 
- Removed termios dependency for UNIX systems.
- Upgraded deps.
- Removed about 1000 lines of code
    - `TerminalOutput` 
    - `Screen`
    - unsafe code
    - Some duplicated code introduced by a previous refactor.
- Raw modes UNIX systems improved     
- Added `NoItalic` attribute
2019-04-10 23:46:30 +02:00

15 lines
440 B
Rust

extern crate crossterm_screen;
use crossterm_screen::{IntoRawMode, RawScreen};
use std::io::{stdout, Write};
use std::{thread, time};
pub fn raw_modes() {
// create a Screen instance who operates on the default output; io::stdout(). By passing in 'true' we make this screen 'raw'
let screen = RawScreen::into_raw_mode();
let screen = stdout().into_raw_mode();
// raw screen will be disabled when it goes out of scope.
}