fwd/vendor/crossterm/examples/is_tty.rs
John Doty 9c435dc440 Vendor dependencies
Let's see how I like this workflow.
2022-12-19 08:38:22 -08:00

18 lines
363 B
Rust

use crossterm::{
execute,
terminal::{size, SetSize},
tty::IsTty,
};
use std::io::{stdin, stdout};
pub fn main() {
println!("{:?}", size().unwrap());
execute!(stdout(), SetSize(10, 10)).unwrap();
println!("{:?}", size().unwrap());
if stdin().is_tty() {
println!("Is TTY");
} else {
println!("Is not TTY");
}
}