lib: use console.log for TTY on Windows
ANSI sequences are emulated on Windows, so use console.log()
for
TTY's on Windows instead of directly writing to the filedescriptor.
Fixes: https://github.com/nodejs/node/issues/27819
This is an alternative to https://github.com/nodejs/node/pull/27823, which is a full revert.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines