is-interactive
Rust adaptation of sindresorhus/is-interactive from NodeJS
Check if stdout or stderr is interactive
It checks that stedout or stderr is TTY, not a dumb terminal, and not running in a CI.
This can be useful to decide whether to present interactive UI or animations in the terminal.
Install
$ cargo add is-interactive
Usage
use is_interactive::is_interactive;
fn main() {
if is_interactive() {
// show beautiful animations
} else {
// skip boring animations
};
}