gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1568 Posts in 518 Topics by 754 Members - Latest Member: irekzawadzki December 03, 2021, 09:02:58 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Macintosh  |  ? how to add highlighting or color to Mac Terminal output
gfx
gfxgfx
 

Author Topic: ? how to add highlighting or color to Mac Terminal output  (Read 3376 times)

jonnygto

  • Newbie
  • *
  • Posts: 16
? how to add highlighting or color to Mac Terminal output
« on: June 21, 2012, 03:38:19 PM »
Does anyone know of a Fortran way to add highlights or color to Mac Terminal output text,
maybe with Write statement control codes of some kind, or system calls?
« Last Edit: June 21, 2012, 03:42:32 PM by jonnygto »

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 321
Re: ? how to add highlighting or color to Mac Terminal output
« Reply #1 on: June 25, 2012, 08:05:15 AM »
You can do it with ANSI escape codes in WRITE statements. Using Google or an equivalent, search for a string something like:

os x terminal ansi codes

Here's a simple example:

        character(len=1), parameter :: esc=char(27)
        print *,'Hello'
        print *,esc,'[','45m','Hello',esc,'[0m'
        print *,'Hello'
        end
« Last Edit: June 25, 2012, 08:11:51 AM by forumadmin »

jonnygto

  • Newbie
  • *
  • Posts: 16
Re: ? how to add highlighting or color to Mac Terminal output
« Reply #2 on: July 09, 2012, 06:03:40 PM »
Thank you for the reply. It helps a lot.

Absoft User Forum  |  Support  |  Macintosh  |  ? how to add highlighting or color to Mac Terminal output
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!