Detect suitable TTY configuration options for the given file (commonly stdout/stderr). This includes feature checks for ANSI escape codes and the Windows console API, as well as respecting the NO_COLOR
and YES_COLOR
environment variables to override the default.