2024-01-16 02:44:48 +00:00
|
|
|
//!
|
|
|
|
|
2024-01-11 02:21:34 +00:00
|
|
|
use keyfork_crossterm::{
|
2024-01-11 02:04:43 +00:00
|
|
|
execute,
|
|
|
|
terminal::{size, SetSize},
|
|
|
|
tty::IsTty,
|
|
|
|
};
|
|
|
|
use std::io::{stdin, stdout};
|
|
|
|
|
2024-01-16 02:44:48 +00:00
|
|
|
fn main() {
|
2024-01-11 02:04:43 +00:00
|
|
|
println!("size: {:?}", size().unwrap());
|
|
|
|
execute!(stdout(), SetSize(10, 10)).unwrap();
|
|
|
|
println!("resized: {:?}", size().unwrap());
|
|
|
|
|
|
|
|
if stdin().is_tty() {
|
|
|
|
println!("Is TTY");
|
|
|
|
} else {
|
|
|
|
println!("Is not TTY");
|
|
|
|
}
|
|
|
|
}
|