We've got a bug report in octave [1] that seems to indicate that gnulib's replacement of isatty is incorrect on Windows 8 (it's fine up to Windows 7). Looking at the implementation, it first calls the Windows _isatty version, then checks the last 2 bits of the handle associated with the file descriptor, based on the assumption described in [2] (a console HANDLE is not a multiple of 4). It seems that this last assumption is not valid anymore on Windows 8.
I provided the bug reporter with a simple program to test on Windows 8, and console HANDLE seems to be a multiple of 4 now. The test program is the following:
#include <io.h>
#include <stdio.h>
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
int main (int argc, char **argv)
{
printf ("isatty (stdin): %d\n", isatty (fileno (stdin)));
printf ("IsConsoleHandle (stdin): %d\n",
IsConsoleHandle (_get_osfhandle (fileno (stdin))));
printf ("isatty (stdout): %d\n", isatty (fileno (stdout)));
printf ("IsConsoleHandle (stdout): %d\n",
IsConsoleHandle (_get_osfhandle (fileno (stdout))));
return 0;
}
The macro IsConsoleHandle is copied from gnulib's isatty.c. This macro seems invalid on Windows 8.
Michael.