Creating a Termcap Entry
There are two reasons for modifying a termcap file. It may be necessary to create a new entry for a new terminal, or it may be necessary to enhance or fix an existing entry. The discussion that follows will show how to create a new entry for a Wyse 60 terminal. However, it is not always necessary to start from scratch. There are often substantial similarities between two kinds of terminals. If there is already a termcap entry that is similar to the desired entry, start with a copy of that entry and make the necessary changes.
Although there are dozens of fields defined by termcap, only the most common will be presented here. Additional information on the fields used in termcap may be found in any termcap reference manual.
The first step in creating a new termcap entry is to get the necessary documentation for the terminal or device. The manual that comes with a new terminal should have a section or appendix listing the features and escape sequences supported by that terminal. Escape sequences may be documented in many different forms. Each manual has its own "legend" that will need to be consulted. For example, the word "ESC" usually represents the ASCII ESCAPE character (code 27) and not the letters "E", "S", "C". If the manual gives a sequence as "ESC Y" it probably means "the ESCAPE character followed by the Y character". Some codes may be expressed in decimal (base 10), hexadecimal (base 16), or octal (base 8). Keep this in mind when setting up a termcap entry (conversion tables between decimal, hex, and octal are frequently contained within technical manuals).
NOTE: Many of the features and characteristics of a terminal are user-definable options. Therefore, the manual should not always be taken as completely definitive. A termcap entry for a Wyse 60 may not be correct for every Wyse 60 because of different option settings.
A terminal may have some features that have no corresponding termcap field. These features will have to be ignored. Conversely, the terminal may lack some features that may be defined in termcap. Those fields are simply omitted from the termcap entry. Also, some applications might not support some termcap fields. If it appears that a termcap feature is not working correctly, then it is possible that the application is at fault. Over the years, some termcap fields have been subject to different interpretations by different programs. In addition, an application may use termcap capabilities that are specific to the application.