infotocap
Convert terminfo descriptions to termcap format
SYNOPSIS
infotocap [-vV] terminfo-source-file...
PARAMETERS
-v
Enables verbose output, providing more information about the conversion process.
-V
Prints the version information for the infotocap command and exits.
DESCRIPTION
infotocap is a utility included with the ncurses library, designed to facilitate compatibility between modern terminal capability descriptions and older systems. Its primary function is to translate terminal descriptions from the terminfo source format into the termcap source format.
Terminfo is the more advanced and flexible standard for describing terminal capabilities, allowing for detailed specifications of a terminal's features, including cursor movement, color support, key definitions, and special modes. Each terminal type typically has its own compiled terminfo entry. In contrast, termcap is an older, simpler format that usually stores all terminal descriptions within a single file (historically /etc/termcap). While simpler, termcap has limitations in expressiveness and capacity compared to terminfo.
Users typically employ infotocap when they need to provide terminal capability information to legacy applications or environments that only understand the termcap format. The command reads a specified terminfo source file (often containing multiple terminal descriptions) and attempts to generate an equivalent termcap source file. It handles most common translations, but due to the inherent differences in the two formats, some complex or terminfo-specific capabilities may not have direct termcap equivalents and might be lost or approximated in the conversion. The output is a human-readable termcap source file, which can then be used by systems requiring that format.
CAVEATS
Terminfo is a richer and more expressive format than termcap. Consequently, not all terminfo capabilities have direct equivalents in termcap. Complex features, certain string parameters, or highly specific terminal controls described in terminfo may be omitted or imperfectly translated when converted to termcap.
The termcap format also has limitations on the size of individual entries, which can sometimes be exceeded by detailed terminfo descriptions. This command is primarily for backward compatibility with older systems; for modern applications, terminfo is the preferred and more robust standard.
PURPOSE AND USAGE CONTEXT
The primary use case for infotocap is to generate termcap source files from terminfo descriptions for systems or applications that have not yet migrated to the terminfo standard. While terminfo is the contemporary and preferred method for describing terminal capabilities, some older Unix-like systems, embedded devices, or specific legacy software may still require a termcap database. infotocap provides the necessary translation step to ensure such environments can correctly interpret and utilize terminal features described in the more modern terminfo format.
OUTPUT STRUCTURE
The output of infotocap is a human-readable text file formatted according to the termcap syntax. Each terminal description typically starts with a line containing various terminal names separated by '|', followed by a series of colon-separated capability definitions. These capabilities include Boolean flags, numeric values, and string sequences that define how a terminal behaves. The generated file is intended to be used as a source for building a termcap database or for direct consumption by applications that parse the termcap format.
HISTORY
infotocap is part of the ncurses (new curses) project, a free software emulation of the System V Release 4.0 (SVr4) curses library. The original curses library and its associated tools were developed to provide a portable way for applications to interact with different types of text-based terminals.
The terminal capability database evolved from termcap (prevalent in BSD systems) to the more powerful and structured terminfo (from System V). As terminfo became the standard, tools like infotocap were developed to bridge the gap, allowing terminfo source files to be utilized by systems or applications still relying on the older termcap format. This ensured backward compatibility and facilitated migration paths for software environments transitioning between these two standards. Its development reflects the ongoing need to support legacy systems while leveraging modern terminal capabilities.