The function isatty is defined in the Microsoft C runtime, and that is
what Mingw uses. This version of isatty determines if a program is
running with stdin/stdout connected to an MS Windows console.
The way that consoles are implemented and used in MS Windows makes it
very complicated to use the console API to simulate a terminal in
Emacs. On Unix-like systems this is done by so-called "pseudo-ttys",
"pty", but the MS Windows consoles are quite different beasts at the
OS API level. Emacs would have to do a large amount of
reverse-engineering of the intent of the child process, to do with
consoles what Emacs does quite naturally on Unix with pseudo-ttys, and
there would still be features missing. Therefore Emacs just uses
anonymous pipes instead which are a much better fit for the way Emacs
treats child processes, but that means that it can't make isatty in
child processes return true.
Cygwin can implement pseudo-ttys if it controls the parent as well as
the child, e.g. when you call a Cygwin program from a Cygwin compiled
Emacs. It uses its own conventions to do that which are not
understood by non-Cygwin programs.
Sometimes you have a program that uses isatty to determine if it
should work in interactive mode or not, like the command shells of a
programming language or the some SQL interpreters. In those cases you
will need to find a way put it into interactive mode without the help
of isatty. Sometimes the shell will have a command-line option for
that, in other cases it can be configured after its start.
benny