gecko-dev/third_party/rust/termion/examples/is_tty.rs

12 строки
216 B
Rust

extern crate termion;
use std::fs;
fn main() {
if termion::is_tty(&fs::File::create("/dev/stdout").unwrap()) {
println!("This is a TTY!");
} else {
println!("This is not a TTY :(");
}
}