Question

I need help identifying what these ANSI escape sequences represent. I'm currently filtering/evaluating the ANSI codes in a terminal screen reader I'm writing, but I'm not sure what these are.

Escape Sequences:

[0;1mm

[0;1;;4m

I'm using the below chart of escape sequences as reference: http://ascii-table.com/ansi-escape-sequences-vt-100.php

Was it helpful?

Solution

ECMA-48 is the primary source of these.

As to your specific examples:

[0;1mm

Is SGR (select graphic rendition) 0 and 1, followed by a normal unescaped m. SGR 0 resets all the rendition attributes, 1 enables bold.

[0;1;;4m

Is SGR 0, 1, 4. 0 resets, 1 enables bold, 4 enables single underline.


EDIT: Actually, I believe this second example is equivalent to

CSI 0;1;0;4 m

which resets, enables bold, resets a second time, then enables underline. So overall, only enables underline, not bold.

OTHER TIPS

The chart you linked to is strictly the codes supported by the VT100 terminal (and the subset supported by VT52). Go to the ANSI Escape sequences chart right next to that one to see the ANSI terminal codes chart, which explains the ESC [ … m sequence. (Those pages are a little confusing about which chart they’re displaying.)

The executive summary is that the codes you posted enable bold and underlined text.

I also recommend the Xterm supported codes chart, which covers codes supported by Xterm and a few other common terminal emulators, as well as some other hardware terminals.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top