captoinfo
Convert terminfo descriptions to termcap
SYNOPSIS
captoinfo [-v n] [-1] [-w n] [-V] [-h] [-o file] [file ...]
PARAMETERS
-v n
Set verbosity level to n. Levels range from 0 (least verbose) to 2 (most verbose). Verbose messages are written to standard error.
-1
Produce one-column output. This is useful for creating terminfo source files that are easier to read and edit.
-w n
Set the maximum line width to n. The default is usually 60.
-V
Display version information and exit.
-h
Display help text and exit.
-o file
Write the terminfo description to the specified file instead of standard output.
[file ...]
Read termcap descriptions from the specified files. If no files are specified, captoinfo reads from standard input.
DESCRIPTION
The captoinfo command translates a termcap description into a terminfo description. Termcap is an older database format for terminal capabilities, while terminfo is a newer, more comprehensive format. captoinfo reads a termcap description, either from a specified file or from standard input, and outputs the equivalent terminfo description. The tool is useful for converting legacy termcap databases for use with applications that rely on terminfo. It helps bridge the gap between older applications using termcap and newer systems that utilize terminfo by creating a readable terminfo source file. The output can then be compiled into a terminfo database using tic.
captoinfo is part of the ncurses library, which provides terminal-independent screen-handling functions. It enables developers to write applications that can adapt to different terminal types without needing to know the specific escape sequences for each terminal. By converting termcap entries, captoinfo aids in maintaining compatibility with older terminal definitions.
EXIT STATUS
captoinfo returns 0 on successful completion. It returns a non-zero value if it encounters errors during processing or if it cannot parse the input termcap descriptions.
FILES
Although captoinfo doesn't directly use terminfo database files, its output is intended to be compiled into those files using the tic command. tic uses files under /usr/share/terminfo to build the actual binary database.
HISTORY
captoinfo emerged as part of the ncurses project, a free software implementation of the curses library. Its primary purpose was to facilitate the migration from termcap databases to the more robust and feature-rich terminfo format. As terminfo became the standard, captoinfo provided a crucial bridge for developers and system administrators to maintain compatibility with older terminal definitions. Its development has been closely tied to the evolution of the ncurses library itself.