Use gnulib isatty module to guarantee isatty.