Add terminal check in examples

This commit is contained in:
2025-06-04 06:03:39 -04:00
parent 5527d501d3
commit d290b1c2e1
2 changed files with 6 additions and 1 deletions

View File

@@ -2,11 +2,13 @@
use neutuino::prelude::*;
use std::{
io::{self, Write},
io::{self, IsTerminal, Write},
thread, time,
};
fn main() -> io::Result<()> {
assert!(io::stdout().is_terminal(), "Not running in a terminal");
enable_ansi()?;
// makes the terminal raw until this value is dropped