LinuxCommandLibrary

colcrt

Filter out reverse line feeds

SYNOPSIS

colcrt [-e] [-x] [file ...]

PARAMETERS

-e
    Prevents the conversion of multiple spaces into tabs. This is useful when the output is intended for programs like 'pr', which might misinterpret tabs.

-x
    Causes colcrt to output spaces for overstriking instead of backspaces. This is intended for terminals that do not support overstriking using backspaces, but it may result in a less visually distinct representation of bold or underlined text.

DESCRIPTION

colcrt is a historical Unix command that acts as a filter, primarily processing the output generated by the col command. Its main purpose is to render nroff or troff formatted documents legibly on basic Cathode Ray Tube (CRT) terminals that lacked advanced text display capabilities, such as direct support for half-line feeds, reverse line feeds, or sophisticated overstriking. Modern terminal emulators typically handle these features inherently.

colcrt achieves its goal by expanding the output vertically and horizontally, substituting complex cursor movements with combinations of newlines and spaces. For instance, reverse line feeds are simulated by inserting enough blank lines and spaces to correctly position subsequent text. Similarly, half-line motions are approximated using full line feeds and additional spacing. Overstriking, commonly used for bold text or underlining in nroff output, is handled by producing character sequences that visually approximate the effect on a CRT, typically by printing a character, backspacing, and then printing the next character. This ensures that documents, especially manual pages, are readable on older, less capable displays.

CAVEATS

Primarily designed for older CRT terminals, colcrt has limited utility on modern terminal emulators or graphical environments that natively handle complex text formatting. It can sometimes produce more output than the col command due to its expansion of line movements and spacing.

TYPICAL USAGE

colcrt is commonly used as the final filter in a pipeline to display formatted text.

Example: Display a man page after processing with nroff and col
nroff -man foo.1 | col | colcrt | less

HISTORY

The colcrt command was developed as part of the early Unix toolchain, originating from Bell Labs. Its existence was crucial for enabling users to preview nroff and troff formatted documents, such as manual pages, on the prevalent character-based CRT terminals of the 1970s and 1980s. These terminals lacked the advanced graphic capabilities or native support for half-line feeds and reverse line feeds that are common in modern display systems. colcrt effectively bridged this gap, ensuring readability. While its direct necessity has diminished with the advent of sophisticated terminal emulators and graphical user interfaces, it remains available for historical compatibility and specific niche requirements.

SEE ALSO

col(1), nroff(1), troff(1), man(1), termcap(5), terminfo(5)

Copied to clipboard