2019-09-16 04:42:12 +10:00
|
|
|
use crossterm_winapi::ScreenBuffer;
|
2019-01-28 07:16:14 +11:00
|
|
|
|
|
|
|
fn print_screen_buffer_information() {
|
|
|
|
let screen_buffer = ScreenBuffer::current().unwrap();
|
|
|
|
|
|
|
|
// get console screen buffer information
|
|
|
|
let csbi = screen_buffer.info().unwrap();
|
|
|
|
|
|
|
|
println!("cursor post: {:?}", csbi.cursor_pos());
|
|
|
|
println!("attributes: {:?}", csbi.attributes());
|
|
|
|
println!("terminal window dimentions {:?}", csbi.terminal_window());
|
|
|
|
println!("terminal size {:?}", csbi.terminal_size());
|
|
|
|
}
|
|
|
|
|
2019-09-16 04:42:12 +10:00
|
|
|
#[allow(dead_code)]
|
2019-01-28 07:16:14 +11:00
|
|
|
fn multiple_screen_buffers() {
|
|
|
|
// create new screen buffer
|
|
|
|
let screen_buffer = ScreenBuffer::create();
|
|
|
|
|
|
|
|
// which to this screen buffer
|
2019-09-16 04:42:12 +10:00
|
|
|
screen_buffer.show().expect("Unable to show screen buffer");
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
print_screen_buffer_information();
|
2019-01-28 07:16:14 +11:00
|
|
|
}
|