Currently we get stdout
on Windows via STDOUT_FILENO
and using get_osfhandle
to get a HANDLE
which we WriteConsoleW
to (unless stdout
was redirected in which case we use WriteFile
). Ideally we should be calling GetStdHandle(STD_OUTPUT_HANDLE)
.