Next: , Previous: , Up: Output Format   [Contents][Index]


3.3 Escape-Sequence Lines

Escape-sequence lines, which begin with the colon, ‘:’, don’t add any new semantics—any characters in an escape-sequence line could be represented on control-character and text lines (and, with just a one-character change in the escape sequence, would be). But they serve to set escape sequences apart from normal control-character or text lines, making it easier to see on one line all the characters that contribute to a single control function, rather than splitting them between control-character and text lines. Here’s an example with some intermixed escape-sequence and text lines (without the usual label and description lines, which are described in later sections):

|Well |
: Esc [ 3 ; 31 m
|Daniel|
: Esc [ 23 ; 39 m
| didn't do it...|.

The two escape-sequence lines represent, respectively, controls that set text rendering to use italics in the color red, and to set normal font rendering in the default color (the actual interpretation of these controls may vary by application).

Note that the escape-sequence lines include control characters (well, character, namely ‘Esc’) intermixed with normal text characters. So the above could have been written like:

|Well |
. ESC
|[3;31mDaniel|
. ESC
|[23;39m didn't do it...|.

But this loses the separation between characters that, yes, happen to be text characters, but really just contribute to some terminal control function invocation, and characters that are, really and truly, text.

: Esc [ 3 ; 31 m

Some things to note. First, the escape key is noted as ‘Esc’, and not ‘ESC’ as it would be in a control-character line. Don’t ask me why; maybe I just felt it was one more thing to dilineate between escape-sequence lines and control-character lines.

Also, each character is separated from its neighbors by a single space, except that strings of digits are lumped all together.

Each character is represented by itself (including colon, as long as it’s not at the start of the line), except the escape character, and the space character (represented as ‘Spc’). Control characters and high-value bytes are not currently represented on escape-sequence lines (they are not part of any escape sequences Teseq recognizes), but if they are in the future (say, as part of non-standardized escape sequences), they will most likely be represented as ‘xXX’ hexadecimal strings (as high-value bytes are represented in control-character lines.

If an escape sequence requires more than one output line, the continuing lines will also begin with a colon, followed by two spaces (instead of one). Lines will not be split in the middle of a number.

: Esc [ 1 ; 2 ; 3 ; 4
:  ; 5 ; 6 ; 7 m

Next: , Previous: , Up: Output Format   [Contents][Index]