captoinfo
Convert terminfo descriptions to termcap
SYNOPSIS
captoinfo [-vVwx] [-w level] [file...]
PARAMETERS
-v
Prints verbose comments and information to standard error during the conversion process, useful for debugging.
-V
Displays the version number of the ncurses library that captoinfo is part of, then exits immediately.
-w level
Sets the warning level for the conversion. level can be 0 (no warnings), 1 (normal warnings, default), or 2 (verbose warnings).
-x
Enables the parsing and emission of extended terminfo capabilities, allowing for more detailed and modern terminal control sequences to be included.
file...
One or more input files containing termcap definitions. If no files are provided, captoinfo reads from standard input.
DESCRIPTION
The captoinfo command serves as a crucial utility for systems transitioning from the older termcap database format to the modern terminfo format. While termcap represented terminal capabilities as a text file, suffering from limitations like size constraints and lack of structure, terminfo evolved to provide a more robust, compiled, and extensible database-driven approach.
captoinfo reads a termcap source file (or standard input if no file is specified) and translates its definitions into a terminfo source file format. This output can then be compiled using the tic(1) command to integrate the terminal's capabilities into the system's terminfo database. It's an essential tool for maintaining compatibility with legacy terminal definitions or for environments that still rely on older termcap descriptions. It is part of the ncurses development libraries, which provide a robust framework for terminal-independent text user interface (TUI) programming.
CAVEATS
While captoinfo performs a valuable translation, it's not always a perfect one-to-one conversion. Some highly specific or obscure termcap idioms may not have direct terminfo equivalents, potentially requiring manual adjustments to the generated terminfo source. It primarily handles the translation of known termcap capabilities to their terminfo counterparts; it doesn't invent new capabilities if they weren't present in the original termcap definition. It's a one-way conversion tool; converting terminfo back to a pure termcap source is generally not its direct function (though infocmp(1) can produce termcap-like output).
TYPICAL USAGE WORKFLOW
A common workflow for captoinfo involves piping its output directly to the tic(1) command. For example: captoinfo old_terminal.termcap | tic -x -v
This command reads termcap definitions from old_terminal.termcap, converts them to terminfo source, and then tic compiles this source, integrating the new or updated terminal definition into the system's terminfo database. The -x
flag ensures extended capabilities are handled, and -v
provides verbose output during compilation.
LEGACY VS. MODERN STANDARD
While captoinfo remains a valuable tool for specific migration and compatibility tasks, terminfo source files are now the standard for defining new terminal capabilities. Most modern terminal definitions are created directly in terminfo format and compiled with tic(1), making direct use of captoinfo less common for everyday terminal management, but indispensable for historical conversions.
HISTORY
The termcap database was the original mechanism for describing terminal capabilities in Unix-like systems, widely used in the 1970s and early 1980s. However, its limitations, such as a fixed-size buffer for entries and lack of strong typing, led to the development of terminfo in the mid-1980s as a more flexible, extensible, and compiled database. captoinfo emerged as a critical utility during this transition period, developed as part of the ncurses project. Its purpose was to assist administrators and developers in migrating their existing, often extensive, termcap definitions to the new terminfo format, thereby ensuring continued terminal compatibility for applications built on the evolving terminfo system.