captoinfo
Convert terminfo descriptions to termcap
SYNOPSIS
captoinfo [-v n] [-1] [-w width] [-V] [file...]
PARAMETERS
-v n
Enable verbose tracing output to stderr. n (1-10) sets detail level; higher values show more processing steps.
-1
Output each terminfo entry as a single line instead of multi-line format (useful for scripts).
-w width
Wrap output lines at width characters in multi-line mode (default: 60).
-V
Print program version to stderr and exit without processing.
DESCRIPTION
captoinfo is a utility from the ncurses package that translates termcap(5) database entries—the legacy format for describing terminal capabilities—into the more efficient, compiled terminfo(5) format used by modern curses libraries.
It reads one or more termcap files (or standard input) containing colon-separated capability descriptions and outputs equivalent terminfo source code to standard output. This source can then be compiled into binary terminfo entries using tic(1).
For example:
captoinfo /etc/termcap | tic
processes the entire termcap file and installs the resulting terminfo entries.
captoinfo maps most standard termcap capabilities to terminfo equivalents, handling boolean, numeric, and string types. It supports common terminals like vt100, xterm, and others. Verbose mode aids debugging complex entries. While effective for migration, some rare or site-specific termcap features may require manual editing post-conversion due to format differences.
This tool is essential for porting old software or systems relying on termcap to terminfo-based environments.
CAVEATS
Does not support all rare termcap extensions; output may need manual tweaks. Processes stdin if no files given, but ignores interactive input. Deprecated in favor of tic for most uses.
TYPICAL WORKFLOW
Pipe output to tic for installation:
captoinfo termcapfile | tic -o $TERMINFO
Replace $TERMINFO with terminfo directory (e.g., /usr/share/terminfo).
LIMITATIONS NOTE
Boolean capabilities prefixed with '!' in termcap become terminfo flags. Use infocmp to verify converted entries.
HISTORY
Originated in early UNIX systems (4.3BSD) for termcap-to-terminfo conversion. Integrated into ncurses (1993+) with enhancements for better compatibility and verbosity. Largely superseded by tic features in modern ncurses.


