LinuxCommandLibrary

infotocap

Convert terminfo descriptions to termcap format

SYNOPSIS

infotocap [-1CDILNRVrvw] [-c chars] [-e pattern] [-0] source ... destination

PARAMETERS

-0
    Use =0 instead of = for padding expressions

-1
    Generate single-character boolean capabilities

-C
    Translate to pre-termcap 5 format

-c chars
    Override ':' and '|' separator characters

-D
    Enable debug output

-e pattern
    Exclude capabilities matching shell glob pattern

-I
    Use terminfo names without padding

-L
    Use long capability names

-N
    Use terminfo names (default)

-r
    Set unknown booleans to false instead of absent

-R
    Use terminfo names with padding

-v n
    Set verbose level (n ≥ 1)

-V n
    Print ncurses version info

-w width
    Wrap output at width columns (default 60)

DESCRIPTION

infotocap is a utility from the ncurses package that converts terminal descriptions from the modern terminfo format into the older termcap format. Terminfo provides a compiled, efficient database of terminal capabilities, while termcap is a text-based format used by legacy applications predating terminfo (introduced in 4.1BSD).

This tool reads one or more terminfo source files (or compiled entries via tic) and generates a termcap entry suitable for programs like vi or other software still relying on /etc/termcap. It handles capability translations, padding expressions, and boolean/string/number types, but some advanced terminfo features may not map perfectly due to termcap's limitations.

Primarily useful for maintaining compatibility with ancient software, porting terminals to termcap-only systems, or debugging terminal databases. Output is written to a specified destination file. Always verify generated entries with tools like captoinfo for round-trip accuracy, as termcap lacks terminfo's extensibility.

CAVEATS

Termcap is obsolete; prefer terminfo. Not all capabilities translate (e.g., no color support). Output often requires manual fixes. Source must be readable terminfo format.

EXAMPLE

infotocap -1v1 xterm.src xterm.cap
Converts xterm.src to xterm.cap with verbose output and short booleans.

OUTPUT NOTES

Generated file uses : separators; test with captoinfo xterm.cap | tic for validation.

HISTORY

Developed for ncurses (1995+) by Eric S. Raymond and Thomas E. Dickey to bridge terminfo (SVr4, 1980s) and termcap (1978, Bill Joy). Maintains legacy support as termcap faded post-1990s.

SEE ALSO

captoinfo(1), tic(1), toe(1), infocmp(1), tput(1)

Copied to clipboard