minicrossterm/examples/is_tty.rs

11 lines
171 B
Rust
Raw Normal View History

use crossterm::tty::IsTty;
use std::io::stdin;
pub fn main() {
if stdin().is_tty() {
println!("Is TTY");
} else {
println!("Is not TTY");
}
}