Go to the first, previous, next, last section, table of contents.


Underlining on most terminals is a kind of appearance mode, much like standout mode. Therefore, it may be implemented using magic cookies or as a flag in the terminal whose current state affects each character that is output. See section Standout and Appearance Modes, for a full explanation.

The `ug' capability is a numeric capability whose presence indicates that the terminal uses magic cookies for underlining. Its value is the number of character positions that a magic cookie for underlining occupies; it is used for underlining just as `sg' is used for standout. Aside from the simplest applications, it is impossible to use underlining correctly without paying attention to the value of `ug'.

String of commands to turn on underline mode or to output a magic cookie to start underlining.
String of commands to turn off underline mode or to output a magic cookie to stop underlining.
Width of magic cookie that represents a change of underline mode; or missing, if the terminal does not use a magic cookie for this.
Flag whose presence means that it is safe to move the cursor while the appearance modes are not in the normal state. Underlining is an appearance mode. If this flag is absent, programs should always turn off underlining before moving the cursor.

There are two other, older ways of doing underlining: there can be a command to underline a single character, or the output of `_', the ASCII underscore character, as an overstrike could cause a character to be underlined. New programs need not bother to handle these capabilities unless the author cares strongly about the obscure terminals which support them. However, terminal descriptions should provide these capabilities when appropriate.

String of commands to underline the character under the cursor, and move the cursor right.
Flag whose presence means that the terminal can underline by overstriking an underscore character (`_'); some terminals can do this even though they do not support overstriking in general. An implication of this flag is that when outputting new text to overwrite old text, underscore characters must be treated specially lest they underline the old text instead.

Go to the first, previous, next, last section, table of contents.