Output from the man
command has bold and underlined text that can be read by less
.
For example, H\x08HE\x08EL\x08LL\x08LO\x08O
displays HELLO (boldface) or H\x08_E\x08_L\x08_L\x08_O\x08_
displays HELLO with an underline.
What is this kind of formatting called?
Best Answer
The method is called overstriking or overtyping, and goes back to the days of typewriters.
Byte 0x08 (aka
\x08
or^H
) is the ASCII "Backspace" character. With typewriters and line-printers, it would move the cursor back one character, so the following character would be printed on paper at the same position as last one. Most commonly, either a character is overstruck over itself (resulting in bold text), or over an underscore_
(resulting in underlined text).Computer terminals normally also delete the backspaced-over character, so this method would no longer work. However, many pagers such as
less
(the default pager used byman
) orw3m
automatically translate the two cases mentioned above into actual bold/underline formatting.(See also ASA carriage control characters used by mainframes and line printers; they have an "overstrike last line" option instead of using Backspace.)
Compare this to combining characters found in Unicode.