Closed
Description
Some programs want to automatically emit color output, or spawn a pager, if output goes to a terminal, but not with redirected output. libtest has a function stdout_isatty
, and rustc's libsyntax has a function stderr_isatty
, with almost identical copy/pasted code other than the fd/handle checked. This strongly suggests the need for a library implementation.
Please consider providing a portable implementation of "isatty" for the Stdin, Stdout, and Stderr types, based on the above implementations from rustc/libtest.