Simplifying isatty check.
Using slightly more repetition to avoid crazy regex.