2022-07-01 04:30:36 +10:00
|
|
|
use crossterm::{tty::IsTty, terminal::{size, SetSize}, execute};
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|