Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Fortran and ANSI Control Codes

Valued Contributor II

Many years ago, about the time of the Compaq Portable Computer - I used MS Fortran 3.31 and it supported ANSI control codes.  <To the nice Intel Rep:: I used the correct term for the computer and thank you for your comments.>

My programs are for small distribution and I chose not to make them beyond console. 

So for a long time the ansi control codes did not work.  I was just playing with an old program, there is a lot you can do in ten minutes as you wait for a program to run and you do not want to lose your place in the long list of files. 

I searched for ansi control codes and it said now supported by Windows terminal - and it worked, but to start the program I have to use .\jarl  == seems a bit UNIX like  - any ideas why?

The ansi codes also worked in a intel terminal window, but you have to change directories to the debug location but the files are often in the code location -- blast the Klingons. 


But it still does not work in a VS console.  But the WT requires the cd to path to be in "path" 

Can I start the Intel terminal from VS - what is the IT based on -- 



0 Kudos
4 Replies
Black Belt Retired Employee

By "Intel Terminal" you mean the Windows Command Prompt window? That's all it is - cmd..exe. This is the same as you get when running a console application from Visual Studio.


Valued Contributor II

No it is not -- the console window in VS does not handle ansi codes - the Intel Program Console on the long program list handles ansi codes -- I spent an hour playing with it yesterday as I ran FFT analysis. 

CMD does not handle ansi codes.  

Black Belt Retired Employee

I'll admit that I was unable to get a test program to work, but I have read in several places that cmd.exe does now support ANSI sequences by default. Wikipedia says:

In 2016, Microsoft released the Windows 10 version 1511 update which unexpectedly implemented support for ANSI escape sequences, over two decades after the debut of Windows NT.[13] The change was designed to complement the Windows Subsystem for Linux, adding to the Windows Console Host used by Command Prompt support for character escape codes used by terminal-based software for Unix-like systems. This is not the default behavior and must be enabled programmatically with the Win32 API via SetConsoleMode(handle, ENABLE_VIRTUAL_TERMINAL_PROCESSING).[14] This was enabled by CMD.EXE but not initially by PowerShell;[15] however, Windows PowerShell 5.1 now enables this by default. Starting with PowerShell 6, it is possible to embed a ESC character into a string via the `e special sequence; For example, "`e[32m".[16] Earlier versions have to use the $([char]27) object; for example, "$([char]27)[32m".

Windows Terminal, introduced in 2019, supports the sequences by default. Microsoft has deprecated the classic Windows Console subsystem and APIs, and intends to replace them with Windows Terminal going forward.[17]

Windows Terminal is something you have to get from the Microsoft Store (free), but I notice it launches PowerShell.

In any case, my answer, that the so-called "Intel Command Prompt" window and what you get for a command prompt window in VS are the same, is correct

Valued Contributor II

I was wrong. 

1. yesterday on a Dell Precision Windows 10 Preview, VS 2109 Preview and using cmd window the ANSI characters showed up in the usual fashion as  <- E 17  type stuff all over the screen. 

2. I downloaded the Windows Terminal after reading about it and I tried PS and both had the ANSI characters working -- 

3. Today all of the cmd WT and PS work properly.  I know the ANSI symbols output on the unsupported screen. 

Here is a sample from 1988 a sewer design program, this was developed on MS 3.31 and A compaq portable.  Excuse the code I have learnt a lot since then - but these programs made us a lot of money. 

After 30 years we are back to 1988.  Darn it feels good. 

PS - Powerstation was the biggest dog god released on the planet.