Code ^[[00;00m
means reset color to default, however, in some programs (like source highlighter highlight
for example) code ^[[m
is used as if it would also serve the same purpose. What does ANSI state about such code, and also about similar ^[[0m
?

- 51,086
- 7
- 70
- 105

- 245
- 3
- 9
1 Answers
"ANSI" in this context was obsoleted long ago by ECMA-48. So the appropriate place to start is that document.
Section 8.3.117 SGR - SELECT GRAPHIC RENDITION says
Notation: (Ps...)
Representation: CSI Ps... 06/13
Parameter default value: Ps = 0
SGR is used to establish one or more graphic rendition aspects for subsequent text. The established aspects remain in effect until the next occurrence of SGR in the data stream, depending on the setting of the GRAPHIC RENDITION COMBINATION MODE (GRCM). Each graphic rendition aspect is specified by a parameter value:
0
default rendition (implementation-defined), cancels the effect of any preceding occurrence of SGR in the data stream regardless of the setting of the GRAPHIC RENDITION COMBINATION MODE (GRCM)
That is, 0
is the default parameter if none is given (so ^[[m
and ^[[0m
mean the same thing. Repeating the parameter also makes no difference (cancelling something that was already cancelled does not uncancel it), so ^[[00;00m
still means the same thing.

- 51,086
- 7
- 70
- 105
-
So `^[[00;00m` also means `^[[m`? – Jerry Epas Sep 18 '15 at 05:56
-
Sure: if a equals b, and b equals c, then a equals c. – Thomas Dickey Sep 18 '15 at 08:01