Written by

Senior Cloud Architect at InterSystems
MOD
Question Eduard Lebedyuk · May 26, 2022

How to produce color text in a terminal

How do I use ANSI escape codes to produce green text in InterSystems IRIS terminal?

Product version: IRIS 2022.1

Comments

Danny Wijnschenk · May 26, 2022

Hi Eduard,

This works in Caché, i guess it should also work on Iris (vt100 escape codes) :

0
Danny Wijnschenk  May 26, 2022 to Danny Wijnschenk
Set Attribute Mode	<ESC>[{attr1};...;{attrn}m
  • Sets multiple display attribute settings. The following lists standard attributes:
    0	Reset all attributes
    1	Bright
    2	Dim
    4	Underscore	
    5	Blink
    7	Reverse
    8	Hidden
    
    	Foreground Colours
    30	Black
    31	Red
    32	Green
    33	Yellow
    34	Blue
    35	Magenta
    36	Cyan
    37	White
    
    	Background Colours
    40	Black
    41	Red
    42	Green
    43	Yellow
    44	Blue
    45	Magenta
    46	Cyan
    47	White
0
Julius Kavay · May 26, 2022

The standard ANSI escape sequenc should be:

write $c(27)_"[42m"_"Your green backround"_$c(27)_"[m"_" and a normal dot."
write $c(27)_"[32m"_"Your green text"_$c(27)_"[m"_" and a normal dot."

0