Function grep_cli::is_tty_stdout
source · pub fn is_tty_stdout() -> bool
Expand description
Returns true if and only if stdout is believed to be connected to a tty or a console.
This is useful for when you want your command line program to produce
different output depending on whether it’s printing directly to a user’s
terminal or whether it’s being redirected somewhere else. For example,
implementations of ls
will often show one item per line when stdout is
redirected, but will condensed output when printing to a tty.