DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
terminfo programming

5. Test the description

Let us consider three ways to test a terminal description. First, you can test it by setting the environment variable $TERMINFO to the path name of the directory containing the description. If programs run the same on the new terminal as they did on the older known terminals, then the new description is functional.

Second, you can test for correct insert line padding by commenting out xon in the description and then editing (using vi(1)) a large file (over 100 lines) at 9600 baud (if possible), and deleting about 15 lines from the middle of the screen. Type u (undo) several times quickly. If the terminal messes up, then more padding is usually required. A similar test can be used for inserting a character.

Third, you can use the tput(1) command. This command outputs a string or an integer according to the type of capability being described. If the capability is a Boolean expression, then tput sets the exit code (0 for TRUE, 1 for FALSE) and produces no output. The general format for the tput command is as follows:

   tput [-Ttype] capname
The type of terminal you are requesting information about is identified with the -Ttype option. Usually, this option is not necessary because the default terminal name is taken from the environment variable $TERM. The capname field is used to show what capability to output from the terminfo database.

The following command line shows how to output the ``clear screen'' character sequence for the terminal being used:

   tput clear
   (The screen is cleared.)

The following command line shows how to output the number of columns for the terminal being used:

   tput cols
   (The number of columns used by the terminal appears here.)
The tput(1) manual page contains more information on the usage and possible messages associated with this command.
Next topic: Comparing or printing terminfo descriptions
Previous topic: 4. Compile the description

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004