ANSI.SYS is coming back! (Sort of)

ANSI.SYS is coming back! (Sort of)

Over the years, Visual Fortran users have asked how to get console applications to display color, bold and move the cursor around. "Back in the day", one could do this by loading the driver ANSI.SYS and sending ANSI escape sequences, but that went away after Windows 95. You can do all that stuff with calls to the Windows API console routines, but who wants to do that?

According to this post, a coming update to Windows 10 completely overhauls the console environment, adding support for many ANSI (and VT100) escape sequences. Looks like fun!

Maybe I'm getting ahead of things. I was thinking more around redirection of standard output, rather than operating system capability (though the latter is perhaps more significant). You see unix terminal programs varying their behaviour on the basis of whether they are running in an [interactive] terminal or with their input/output redirected to a file or pipe - `myprogram.exe` versus `myprogram.exe > some_file.txt` - you don't want to be writing a whole lot of escape codes to a flat text file.

Perhaps it is a case of checking whether the program's GetStdHandle output handle (assuming `WRITE (OUTPUT_UNIT...` always ends up writing to that?) works with the Console API. Not sure.