Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
11 Views

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!

Retired 12/31/2016
0 Kudos
5 Replies
Highlighted
Black Belt
11 Views

How can/should/will an Intel

How can/should/will an Intel Fortran program determine whether OUTPUT_UNIT refers to a console with escape sequence support, or a file (or - what's the equivalent of isattty)?  An extension to INQUIRE?
 

0 Kudos
Highlighted
11 Views

I have no idea. You may just

I have no idea. You may just have to base it on a detailed Windows version check. Perhaps there will be an API for asking details on console support.

Retired 12/31/2016
0 Kudos
Highlighted
Black Belt
11 Views

Maybe I'm getting ahead of

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.

0 Kudos
Highlighted
Valued Contributor II
11 Views

It is only tangent to the

It is only tangent to the current discussion, but there is a nice little project on SourceForge which would help: http://foul.sourceforge.net/

 

0 Kudos
Highlighted
New Contributor II
11 Views

Quote:ianh wrote:

ianh wrote:

How can/should/will an Intel Fortran program determine whether OUTPUT_UNIT refers to a console with escape sequence support, or a file (or - what's the equivalent of isattty)?  An extension to INQUIRE?
 

Hello Long time ago, I remember that I performed a check to test whether ansi.sys was activated or not. If you are interested, I will search back in my archives to find this test.
0 Kudos