<s>
The	O
escape	O
codes	O
sent	O
to	O
the	O
terminal	O
perform	O
various	O
functions	O
that	O
a	O
CRT	B-Device
terminal	O
(	O
and	O
software	O
terminal	B-Application
emulators	I-Application
)	O
is	O
capable	O
of	O
,	O
but	O
that	O
a	O
teletypewriter	O
is	O
not	O
;	O
such	O
as	O
moving	O
the	O
terminal	O
's	O
cursor	O
to	O
positions	O
on	O
the	O
screen	O
,	O
clearing	O
and	O
scrolling	O
all	O
or	O
parts	O
of	O
the	O
screen	O
,	O
turning	O
on	O
and	O
off	O
attached	O
printer	O
devices	O
,	O
programming	O
programmable	O
function	B-Application
keys	I-Application
,	O
changing	O
display	O
colours	O
and	O
attributes	O
(	O
such	O
as	O
reverse	B-General_Concept
video	I-General_Concept
)	O
,	O
and	O
setting	O
display	O
title	O
strings	O
.	O
</s>
<s>
The	O
escape	O
codes	O
received	O
from	O
the	O
terminal	O
signify	O
things	O
such	O
as	O
function	B-Application
key	I-Application
,	O
arrow	B-Device
key	I-Device
,	O
and	O
other	O
special	O
key	O
(	O
home	B-Device
key	I-Device
,	O
end	B-Device
key	I-Device
,	O
help	B-Protocol
key	I-Protocol
,	O
PgUp	B-Device
key	I-Device
,	O
PgDn	B-Device
key	I-Device
,	O
insert	B-Device
key	I-Device
,	O
delete	B-Device
key	I-Device
,	O
and	O
so	O
forth	O
)	O
keystrokes	O
.	O
</s>
<s>
In	O
Unix	O
and	O
other	O
POSIX-compliant	O
systems	O
that	O
support	O
the	O
POSIX	B-Application
terminal	I-Application
interface	I-Application
,	O
these	O
capabilities	O
are	O
encoded	O
in	O
databases	O
that	O
are	O
configured	O
by	O
a	O
system	O
administrator	O
and	O
accessed	O
from	O
programs	O
via	O
the	O
terminfo	B-Device
library	O
(	O
which	O
supersedes	O
the	O
older	O
termcap	B-Application
library	O
)	O
,	O
upon	O
which	O
in	O
turn	O
are	O
built	O
libraries	O
such	O
as	O
the	O
curses	B-Device
and	O
ncurses	B-Language
libraries	O
,	O
by	O
which	O
applications	O
programs	O
use	O
the	O
terminal	B-Application
capabilities	I-Application
to	O
provide	O
textual	B-Application
user	I-Application
interfaces	I-Application
with	O
windows	O
,	O
dialogue	O
boxes	O
,	O
buttons	O
,	O
labels	O
,	O
input	O
fields	O
,	O
menus	O
,	O
and	O
so	O
forth	O
.	O
</s>
<s>
The	O
(	O
for	O
"	O
terminal	B-Application
capabilities	I-Application
"	O
)	O
library	O
was	O
developed	O
for	O
BSD	O
systems	O
.	O
</s>
<s>
These	O
comprise	O
the	O
control	O
codes	O
and	O
escape	O
sequences	O
that	O
the	O
terminal	O
sends	O
to	O
the	O
host	O
to	O
represent	O
various	O
actions	O
and	O
events	O
,	O
such	O
as	O
function	B-Application
keys	I-Application
and	O
arrow	B-Device
keys	I-Device
being	O
pressed	O
.	O
</s>
<s>
The	O
terminfo	B-Device
(	O
"	O
terminal	O
information	O
"	O
)	O
library	O
was	O
developed	O
for	O
System	O
V	O
systems	O
.	O
</s>
<s>
(	O
Its	O
location	O
is	O
n't	O
even	O
uniform	O
across	O
different	O
distributions	B-Application
of	I-Application
Linux	I-Application
.	O
)	O
</s>
<s>
Unlike	O
the	O
termcap	B-Application
database	O
,	O
the	O
terminfo	B-Device
database	O
is	O
compiled	O
,	O
a	O
machine-readable	O
database	O
that	O
is	O
constructed	O
from	O
a	O
human-readable	O
source	O
file	O
format	O
by	O
a	O
utility	O
program	O
,	O
.	O
</s>
<s>
The	O
command	O
to	O
output	O
the	O
human-readable	O
form	O
of	O
the	O
"	O
vt100	B-Device
"	O
terminal	O
definition	O
,	O
for	O
example	O
,	O
is	O
:	O
</s>
<s>
The	O
use	O
of	O
a	O
machine-readable	O
format	O
was	O
to	O
avoid	O
the	O
unnecessary	O
overhead	O
,	O
in	O
applications	O
programs	O
using	O
systems	O
such	O
as	O
the	O
termcap	B-Application
library	O
,	O
of	O
repeatedly	O
parsing	O
the	O
database	O
content	O
to	O
read	O
the	O
fields	O
of	O
a	O
record	O
.	O
</s>
<s>
Originally	O
,	O
Unix	O
had	O
severe	O
performance	O
problems	O
with	O
large	O
directories	O
containing	O
many	O
files	O
,	O
and	O
thus	O
terminfo	B-Device
uses	O
a	O
two-level	O
structure	O
,	O
dividing	O
up	O
the	O
directory	O
entries	O
by	O
first	O
letter	O
into	O
a	O
series	O
of	O
subdirectories	O
.	O
</s>
<s>
More	O
recent	O
filesystem	O
formats	O
used	O
on	O
Unix	O
systems	O
do	O
n't	O
suffer	O
as	O
much	O
from	O
such	O
problems	O
(	O
because	O
their	O
on-disc	O
directory	O
structures	O
are	O
no	O
longer	O
simple	O
arrays	O
of	O
entries	O
,	O
but	O
are	O
organized	O
into	O
trees	O
or	O
hash	O
tables	O
)	O
and	O
so	O
the	O
necessity	O
for	O
this	O
design	O
element	O
,	O
that	O
still	O
exists	O
in	O
modern	O
terminfo	B-Device
implementations	O
,	O
has	O
since	O
disappeared	O
.	O
</s>
<s>
On	O
Unix	O
systems	O
,	O
the	O
command	O
is	O
used	O
to	O
look	O
up	O
a	O
specific	O
capability	O
in	O
the	O
system	O
's	O
database	O
,	O
and	O
output	O
it	O
to	O
the	O
command	O
's	O
standard	B-Operating_System
output	I-Operating_System
(	O
which	O
is	O
,	O
presumably	O
,	O
the	O
terminal	O
by	O
which	O
the	O
function	O
denoted	O
by	O
the	O
capability	O
is	O
to	O
be	O
performed	O
)	O
.	O
</s>
<s>
Normally	O
the	O
command	O
uses	O
the	O
terminal	O
type	O
specified	O
by	O
the	O
TERM	O
environment	O
variable	O
,	O
one	O
of	O
the	O
controlling	O
environment	O
variables	O
of	O
the	O
POSIX	B-Application
terminal	I-Application
interface	I-Application
.	O
</s>
<s>
So	O
,	O
for	O
example	O
,	O
to	O
issue	O
the	O
reset	O
sequence	O
appropriate	O
for	O
the	O
type	O
of	O
terminal	O
named	O
"	O
vt100	B-Device
"	O
in	O
the	O
database	O
(	O
usually	O
a	O
DEC	B-Device
VT100	I-Device
terminal	O
)	O
,	O
irrespective	O
of	O
terminal	O
type	O
specified	O
in	O
environment	O
variables	O
,	O
the	O
command	O
is	O
:	O
</s>
