Creating a vvtermcap Entry for a Different Terminal

If you wish to support a type of terminal that does not have an entry in vvtermcap, you will have to create one and add it to the vvtermcap file. The best way to do this is to modify an existing termcap or vvtermcap entry.

This section describes how to create a new vvtermcap entry for a different type of terminal. Here, we assume that you do not wish to support any commands beyond those already provided in the default vvtermcap interface. If you want to support fields other than those listed in Table 58.1, you will have to read further in this chapter.

Step 1: Select a terminal entry to modify.

UNIX and XENIX users can check to see if your terminal is defined in the /etc/termcap file supplied with your version of UNIX/XENIX. If your terminal is defined in the termcap file, copy that entry to vvtermcap using any text editor.

VMS users and UNIX/XENIX users who do not find the terminal in termcap should copy the definition closest to your terminal from vvtermcap.

Step 2: Make sure all needed vvtermcap fields are present.

Note: This section only lists the fields you will need to include in your vvtermcap entry. You should consult the terminal manual for more information about the control sequences and values to use for each field and the capabilities available on the terminal.

In addition to the name field, three other fields are required for Vermont Views to be operational. They are listed in Table 58.4.

Table 58.4: Mnemonic Fields Required in vvtermcap

Name Type Description
cm TDF_STR Cursor motion
co TDF_INT Number of columns on the screen
li TDF_INT Number of lines on the screen

The three required fields provide minimal functionality for a Vermont Views application. You will not be able to specify video attributes other than NORMAL, and the application will not be able to recognize many of the keys used in interactive processing.

Generally, to achieve full functionality, you should include fields for all the mnemonics listed in Table 58.1. Specifically, you should include the fields controlling video attributes and the fields that generate the keycodes used in your application.

Table 58.5 lists the monochrome and color attributes and the mnemonics that you will need to include to support those video attributes.

Table 58.5: Fields to Include to Support Different Attributes

Terminal Attribute Mnemonic Set, Reset
REVERSE so, se
HIGH_INT HS, HR
BLINK BB, BR
UNDERLINE us, ue
COLOR# scl#, rcl#

For key assignments, you should review your application to determine what keycodes you will be needing in your interactive processes. Then, you should ensure that these keycodes are defined in the vvtermcap entry. Table 58.6 lists the keycodes used in all keytables as provided in Vermont Views and the mnemonics for the fields that define them. In the default vvtermcap files, we have mapped keys available in PCDOS and not available on terminal keyboards to available terminal keys or key combinations. Check your vvtermcap file for the key assignments for your terminal.

It is not necessary to delete any extraneous information from the entry you copied from termcap, although parsing will speed up with fewer fields. Some of these extra entries may define several of the optional commands that Vermont Views can use, for example, setting various video attribute modes. The extra entries are not strictly necessary, but you may want to keep them for future use.

Step 3: Ensure proper initialization of the terminal.

Note: This step is recommended.

Vermont Views assumes that the terminal starts out in the NORMAL video mode. There is no guarantee that this will occur automatically. The terminal should be set to NORMAL by specifying an initialization string in vvtermcap. The mnemonic for the initialization string field is "is".

In addition to setting the terminal to NORMAL, you may wish to initialize other aspects of the terminal. If the initialization in vvtermcap is not satisfactory, or the terminal is not in vvtermcap, you will need the terminal documentation to determine the definitions for specific initializations.

Here is an initialization string for the VT100 that may be appropriate for Vermont Views:

:is=\E>\E[?3l\E[?4l\E[?5l\E[?8h:

The initialization string performs the following actions:

    Sets Numeric keypad mode    \E>

    Sets 80 columns and clears screen    \E[?3l

    Sets jump scrolling    \E[?4l

    Sets NORMAL video    \E[?5l

    Sets auto-repeat on    \E[?8h

Table 58.6: Keycodes That Should Be Defined in vvtermcap

Keycode Mnemonic to include in vvtermcap Label Mnemonic
KEY_HOME kh L_kh
KEY_CHOME SXU L_SXU
KEY_END EN L_EN
KEY_CEND SXD L_SXD
KEY_UP ku L_ku
KEY_DN kd L_kd
KEY_PGUP PU L_PU
KEY_CPGUP SPU L_SPU
KEY_PGDN PD L_PD
KEY_CPGDN SPD L_SPD
KEY_LEFT kl L_kl
KEY_CLEFT PL L_PL
KEY_RIGHT kr L_kr
KEY_CRIGHT PR L_PR
KEY_ESC ESC L_ESC
KEY_INS ki L_ki
KEY_DEL DL L_DL
KEY_BACK bc L_bc
KEY_STAB bt L_bt
KEY_F1 k0 L_k0
KEY_AF1 ZM L_ZM
KEY_F2 k1 L_k1
KEY_CF2 Ck1 L_Ck1
KEY_AF2 Akf1 L_Akf1
KEY_F3 k2 L_k2
KEY_SF3 Sk2 L_Sk2
KEY_F4 k3 L_k3
KEY_CF4 Ck3 L_Ck3
KEY_SF4 Sk3 L_Sk3
KEY_F5 k4 L_k4
KEY_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