Function grep_cli::is_tty_stdout

source ·
pub fn is_tty_stdout() -> bool
👎Deprecated since 0.1.10: use std::io::IsTerminal instead
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.

Note that this is now just a wrapper around std::io::IsTerminal. Callers should prefer using the IsTerminal trait directly. This routine is deprecated and will be removed in the next semver incompatible release.