2022-07-03 05:39:25 +10:00
|
|
|
use crossterm::{
|
|
|
|
execute,
|
|
|
|
terminal::{size, SetSize},
|
|
|
|
tty::IsTty,
|
|
|
|
};
|
2022-07-01 04:30:36 +10:00
|
|
|
use std::io::{stdin, stdout};
|
2020-03-29 04:38:07 +11:00
|
|
|
|
|
|
|
pub fn main() {
|
2022-07-01 04:30:36 +10:00
|
|
|
println!("{:?}", size().unwrap());
|
|
|
|
execute!(stdout(), SetSize(10, 10)).unwrap();
|
|
|
|
println!("{:?}", size().unwrap());
|
|
|
|
|
2020-03-29 04:38:07 +11:00
|
|
|
if stdin().is_tty() {
|
|
|
|
println!("Is TTY");
|
|
|
|
} else {
|
|
|
|
println!("Is not TTY");
|
|
|
|
}
|
|
|
|
}
|