<s>
curses	B-Device
is	O
a	O
terminal	B-General_Concept
control	O
library	B-Library
for	O
Unix-like	B-Operating_System
systems	I-Operating_System
,	O
enabling	O
the	B-Language
construction	O
of	O
text	B-Application
user	I-Application
interface	I-Application
(	O
TUI	O
)	O
applications	O
.	O
</s>
<s>
The	B-Language
name	O
is	O
a	O
pun	O
on	O
the	B-Language
term	O
"	O
cursor	B-Application
optimization	O
"	O
.	O
</s>
<s>
It	O
is	O
a	O
library	B-Library
of	O
functions	O
that	O
manage	O
an	O
application	O
's	O
display	O
on	O
character-cell	O
terminals	O
(	O
e.g.	O
,	O
VT100	B-Device
)	O
.	O
</s>
<s>
Using	O
curses	B-Device
,	O
programmers	O
are	O
able	O
to	O
write	O
text-based	B-Application
applications	O
without	O
writing	O
directly	O
for	O
any	O
specific	O
terminal	B-General_Concept
type	O
.	O
</s>
<s>
The	B-Language
curses	B-Device
library	B-Library
on	O
the	B-Language
executing	O
system	O
sends	O
the	B-Language
correct	O
control	O
characters	O
based	O
on	O
the	B-Language
terminal	B-General_Concept
type	O
.	O
</s>
<s>
It	O
provides	O
an	O
abstraction	O
of	O
one	O
or	O
more	O
windows	O
that	O
maps	O
onto	O
the	B-Language
terminal	B-General_Concept
screen	O
.	O
</s>
<s>
The	B-Language
programmer	O
sets	O
up	O
the	B-Language
desired	O
appearance	O
of	O
each	O
window	O
,	O
then	O
tells	O
the	B-Language
curses	B-Device
package	O
to	O
update	O
the	B-Language
screen	O
.	O
</s>
<s>
The	B-Language
library	B-Library
determines	O
a	O
minimal	O
set	O
of	O
changes	O
that	O
are	O
needed	O
to	O
update	O
the	B-Language
display	O
and	O
then	O
executes	O
these	O
using	O
the	B-Language
terminal	B-General_Concept
's	O
specific	O
capabilities	O
and	O
control	O
sequences	O
.	O
</s>
<s>
In	O
short	O
,	O
this	O
means	O
that	O
the	B-Language
programmer	O
simply	O
creates	O
a	O
character	O
matrix	O
of	O
how	O
the	B-Language
screen	O
should	O
look	O
and	O
lets	O
curses	B-Device
handle	O
the	B-Language
work	O
.	O
</s>
<s>
The	B-Language
curses	B-Device
API	B-Application
is	O
described	O
in	O
several	O
places	O
.	O
</s>
<s>
Most	O
implementations	O
of	O
curses	B-Device
use	O
a	O
database	O
that	O
can	O
describe	O
the	B-Language
capabilities	O
of	O
thousands	O
of	O
different	O
terminals	O
.	O
</s>
<s>
There	O
are	O
a	O
few	O
implementations	O
,	O
such	O
as	O
PDCurses	B-Device
,	O
which	O
use	O
specialized	O
device	O
drivers	O
rather	O
than	O
a	O
terminal	B-General_Concept
database	O
.	O
</s>
<s>
Most	O
implementations	O
use	O
terminfo	B-Device
;	O
some	O
use	O
termcap	B-Application
.	O
</s>
<s>
Curses	B-Device
has	O
the	B-Language
advantage	O
of	O
back-portability	O
to	O
character-cell	O
terminals	O
and	O
simplicity	O
.	O
</s>
<s>
For	O
an	O
application	O
that	O
does	O
not	O
require	O
bit-mapped	O
graphics	O
or	O
multiple	O
fonts	O
,	O
an	O
interface	O
implementation	O
using	O
curses	B-Device
will	O
usually	O
be	O
much	O
simpler	O
and	O
faster	O
than	O
one	O
using	O
an	O
X	B-Operating_System
toolkit	O
.	O
</s>
<s>
The	B-Language
first	O
curses	B-Device
library	B-Library
was	O
written	O
by	O
Ken	O
Arnold	O
and	O
originally	O
released	O
with	O
BSD	B-Operating_System
UNIX	I-Operating_System
,	O
where	O
it	O
was	O
used	O
for	O
several	O
games	O
,	O
most	O
notably	O
Rogue	B-Application
.	O
</s>
<s>
Some	O
improvements	O
were	O
made	O
to	O
the	B-Language
BSD	B-Operating_System
library	B-Library
in	O
the	B-Language
1990s	O
as	O
"	O
4.4BSD	O
"	O
curses	B-Device
,	O
e.g.	O
,	O
to	O
provide	O
more	O
than	O
one	O
type	O
of	O
video	O
highlighting	O
.	O
</s>
<s>
The	B-Language
name	O
"	O
curses	B-Device
"	O
is	O
a	O
pun	O
on	O
cursor	B-Application
optimization	O
.	O
</s>
<s>
Sometimes	O
it	O
is	O
incorrectly	O
stated	O
that	O
curses	B-Device
was	O
used	O
by	O
the	B-Language
vi	B-Application
editor	I-Application
.	O
</s>
<s>
In	O
fact	O
the	B-Language
code	O
in	O
curses	B-Device
that	O
optimizes	O
moving	O
the	B-Language
cursor	B-Application
from	O
one	O
place	O
on	O
the	B-Language
screen	O
to	O
another	O
was	O
borrowed	O
from	O
vi	B-Application
,	O
which	O
predated	O
curses	B-Device
.	O
</s>
<s>
According	O
to	O
Goodheart	O
,	O
Ken	O
Arnold	O
's	O
original	O
implementation	O
of	O
curses	B-Device
started	O
by	O
reusing	O
functions	O
from	O
the	B-Language
termcap	B-Application
library	B-Library
,	O
and	O
adding	O
to	O
that	O
.	O
</s>
<s>
A	O
few	O
years	O
later	O
,	O
Mary	O
Ann	O
Horton	O
,	O
who	O
had	O
maintained	O
the	B-Language
vi	B-Application
and	O
termcap	B-Application
sources	O
at	O
Berkeley	O
,	O
went	O
to	O
AT&T	O
Corporation	O
and	O
made	O
a	O
different	O
version	O
using	O
terminfo	B-Device
,	O
which	O
became	O
part	O
of	O
UNIX	B-Operating_System
System	I-Operating_System
III	I-Operating_System
and	O
UNIX	B-Operating_System
System	I-Operating_System
V	I-Operating_System
.	O
Due	O
to	O
licensing	O
restrictions	O
on	O
the	B-Language
latter	O
,	O
the	B-Language
BSD	B-Operating_System
and	O
AT&T	O
versions	O
of	O
the	B-Language
library	B-Library
were	O
developed	O
independently	O
.	O
</s>
<s>
In	O
addition	O
to	O
the	B-Language
termcap/terminfo	O
improvement	O
,	O
other	O
improvements	O
were	O
made	O
in	O
the	B-Language
AT&T	O
version	O
:	O
</s>
<s>
video	O
highlighting	O
(	O
bold	O
,	O
underline	O
)	O
The	B-Language
BSD	B-Operating_System
version	O
supported	O
only	O
standout	O
.	O
</s>
<s>
line-drawing	O
The	B-Language
BSD	B-Operating_System
version	O
gave	O
little	O
support	O
here	O
.	O
</s>
<s>
colors	O
This	O
was	O
not	O
supported	O
in	O
the	B-Language
BSD	B-Operating_System
version	O
.	O
</s>
<s>
AT&T	O
curses	B-Device
development	O
appears	O
to	O
have	O
halted	O
in	O
the	B-Language
mid-1990s	O
when	O
X/Open	O
Curses	B-Device
was	O
defined	O
.	O
</s>
<s>
However	O
,	O
development	O
of	O
ncurses	B-Language
and	O
PDCurses	B-Device
continues	O
.	O
</s>
<s>
A	O
version	O
of	O
BSD	B-Operating_System
curses	B-Device
continues	O
to	O
be	O
maintained	O
in	O
the	B-Language
NetBSD	B-Device
operating	O
system	O
(	O
wide	O
character	O
support	O
,	O
termcap	B-Application
to	O
terminfo	B-Device
migration	O
,	O
etc	O
.	O
</s>
<s>
Different	O
lines	O
of	O
development	O
started	O
by	O
imitating	O
the	B-Language
AT&T	O
curses	B-Device
,	O
from	O
at	O
least	O
three	O
implementations	O
:	O
pcurses	O
by	O
Pavel	O
Curtis	O
(	O
started	O
in	O
1982	O
)	O
,	O
PDCurses	B-Device
(	O
Public	O
Domain	O
curses	B-Device
)	O
by	O
Mark	O
Hessling	O
to	O
support	O
his	O
editor	O
THE	B-Language
(	O
started	O
in	O
1987	O
)	O
as	O
well	O
as	O
Rexx/Curses	O
,	O
and	O
PC	O
curses	B-Device
(	O
version	O
1.4	O
and	O
earlier	O
by	O
Bjorn	O
Larsson-based	O
inspired	O
by	O
Pavel	O
Curtis	O
 '	O
library	B-Library
before	O
1990	O
.	O
)	O
</s>
<s>
ncurses	B-Language
(	O
new	B-Language
curses	I-Language
)	O
"	O
originated	O
as	O
pcurses	O
...	O
and	O
was	O
re-issued	O
as	O
ncurses	B-Language
1.8.1	O
in	O
late	O
1993	O
"	O
.	O
</s>
<s>
ncurses	B-Language
is	O
the	B-Language
most	O
widely	O
known	O
implementation	O
of	O
curses	B-Device
,	O
and	O
has	O
motivated	O
further	O
development	O
of	O
other	O
variations	O
,	O
such	O
as	O
BSD	B-Operating_System
curses	B-Device
in	O
the	B-Language
NetBSD	B-Device
project	O
.	O
</s>
<s>
Although	O
the	B-Language
ncurses	B-Language
library	B-Library
was	O
initially	O
developed	O
under	O
Linux	O
,	O
OpenBSD	O
,	O
FreeBSD	O
,	O
and	O
NetBSD	B-Device
,	O
it	O
has	O
been	O
ported	O
to	O
many	O
other	O
ANSI/POSIX	O
UNIX	O
systems	O
,	O
mainly	O
by	O
Thomas	B-Application
Dickey	I-Application
.	O
</s>
<s>
PDCurses	B-Device
,	O
while	O
not	O
identical	O
to	O
ncurses	B-Language
,	O
uses	O
the	B-Language
same	O
function	O
calls	O
and	O
operates	O
the	B-Language
same	O
way	O
as	O
ncurses	B-Language
does	O
except	O
that	O
PDCurses	B-Device
targets	O
different	O
devices	O
,	O
e.g.	O
,	O
console	O
windows	O
for	O
DOS	B-Device
,	O
Win32	B-Library
,	O
OS/2	B-Application
,	O
as	O
well	O
as	O
X11	B-Operating_System
.	O
</s>
<s>
Porting	O
between	O
the	B-Language
two	O
is	O
not	O
difficult	O
.	O
</s>
<s>
For	O
example	O
,	O
the	B-Language
roguelike	O
game	O
ADOM	B-Application
was	O
written	O
for	O
Linux	O
and	O
ncurses	B-Language
,	O
later	O
ported	O
to	O
DOS	B-Device
and	O
PDCurses	B-Device
.	O
</s>
<s>
Curses-based	B-Device
software	I-Device
is	O
software	O
whose	O
user	B-Application
interface	I-Application
is	O
implemented	O
through	O
the	B-Language
curses	B-Device
library	B-Library
,	O
or	O
a	O
compatible	O
library	B-Library
(	O
such	O
as	O
ncurses	B-Language
)	O
.	O
</s>
<s>
Curses	B-Device
is	O
designed	O
to	O
facilitate	O
GUI-like	O
functionality	O
on	O
a	O
text-only	B-Application
device	O
,	O
such	O
as	O
a	O
PC	O
running	O
in	O
console	O
mode	O
,	O
a	O
hardware	O
ANSI	O
terminal	B-General_Concept
,	O
a	O
Telnet	B-Protocol
or	O
SSH	B-Protocol
client	O
,	O
or	O
similar	O
.	O
</s>
<s>
Curses-based	O
programs	O
often	O
have	O
a	O
user	B-Application
interface	I-Application
that	O
resembles	O
a	O
traditional	O
graphical	O
user	B-Application
interface	I-Application
,	O
including	O
'	O
widgets	O
 '	O
such	O
as	O
text	O
boxes	O
and	O
scrollable	O
lists	O
,	O
rather	O
than	O
the	B-Language
command	B-Application
line	I-Application
interface	I-Application
(	O
CLI	O
)	O
most	O
commonly	O
found	O
on	O
text-only	B-Application
devices	O
.	O
</s>
<s>
This	O
can	O
make	O
them	O
more	O
user-friendly	O
than	O
a	O
CLI-based	O
program	O
,	O
while	O
still	O
being	O
able	O
to	O
run	O
on	O
text-only	B-Application
devices	O
.	O
</s>
<s>
Curses-based	B-Device
software	I-Device
can	O
also	O
have	O
a	O
lighter	O
resource	O
footprint	O
and	O
operate	O
on	O
a	O
wider	O
range	O
of	O
systems	O
(	O
both	O
in	O
terms	O
of	O
hardware	O
and	O
software	O
)	O
than	O
their	O
GUI-based	O
counterparts	O
.	O
</s>
<s>
This	O
includes	O
old	O
pre-1990	O
machines	O
along	O
with	O
modern	O
embedded	O
systems	O
using	O
text-only	B-Application
displays	O
.	O
</s>
<s>
Curses	B-Device
is	O
most	O
commonly	O
associated	O
with	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
although	O
implementations	O
for	O
Microsoft	B-Application
Windows	I-Application
also	O
exist	O
.	O
</s>
