What is terminfo?
terminfo refers to both of the following:
-
It is a group of routines within the curses library
that handles certain terminal capabilities.
You can use these terminfo
routines to write a filter or program the function keys,
if your terminal has programmable keys.
Shell programmers can use the command
tput(1)
to perform many of the manipulations provided by these routines.
-
It is a database
containing the descriptions of many terminals
that can be used with curses programs.
These descriptions specify the capabilities of a terminal
and the way it performs various operations--for example,
how many lines and columns it has and
how its control characters are interpreted.
Each terminal description in the database is a separate, compiled file.
You use the source code that
oldterminfo(4)
describes to create these files
and the command
tic(1M)
to compile them.
The compiled files
are normally located in the directories
/usr/share/lib/terminfo/?.
These directories
have single character names, each of which is the first character
in the name of a terminal.
For example,
an entry for the AT&T Teletype 5425 is normally located in the file
/usr/share/lib/terminfo/a/att5425.
Here is a simple shell script that uses the terminfo database.
# Clear the screen and show the 0,0 position.
tput clear
tput cup 0 0 # or tput home
echo "<- this is 0 0"
# Show line 5, column 10.
tput cup 5 10
echo "<- this is 5 10"
A shell script using terminfo routines
Next topic:
Working with terminfo routines
Previous topic:
Organization of this topic
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004