.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: ncurses.3x,v 1.159 2023/06/17 17:50:37 tom Exp $
+.\" $Id: ncurses.3x,v 1.162 2023/07/01 15:21:06 tom Exp $
.hy 0
-.TH ncurses 3X 2023-06-17 "ncurses 6.4" "Library calls"
+.TH ncurses 3X 2023-07-01 "ncurses 6.4" "Library calls"
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
\fBncurses\fP \- CRT screen handling and optimization package
.SH SYNOPSIS
\fB#include <curses.h>\fP
-.br
.SH DESCRIPTION
The \fBncurses\fP library routines give the user a terminal-independent method
of updating character screens with reasonable optimization.
routines; color manipulation; use of soft label keys; terminfo capabilities;
and access to low-level terminal-manipulation routines.
.SS Initialization
-.PP
The library uses the locale which the calling program has initialized.
That is normally done with \fBsetlocale\fP(3):
.NS
\fB@TSET@(1)\fP is usually responsible for doing this.
[See \fBterminfo\fP(\*n) for further details.]
.SS Datatypes
-.PP
The \fBncurses\fP library permits manipulation of data structures,
called \fIwindows\fP, which can be thought of as two-dimensional
arrays of characters representing all or part of a CRT screen.
drawing characters, and input values use names, defined in \fB<curses.h>\fP,
such as \fBA_REVERSE\fP, \fBACS_HLINE\fP, and \fBKEY_LEFT\fP.
.SS Environment variables
-.PP
If the environment variables \fBLINES\fP and \fBCOLUMNS\fP are set, or if the
program is executing in a window environment, line and column information in
the environment will override information read by \fIterminfo\fP.
a \*(``_w\*('' is inserted into the name.
For example, \fBwaddch\fP becomes \fBwadd_wch\fP.
.RE
-.PP
.\"
.SS Routine Name Index
The following table lists the \fBcurses\fP routines provided in
.PP
Routines that return pointers return \fBNULL\fP on error.
.SH ENVIRONMENT
-.PP
The following environment symbols are useful for customizing the
runtime behavior of the \fBncurses\fP library.
The most important ones have been already discussed in detail.
.SS CC command-character
-.PP
When set, change occurrences of the command_character
(i.e., the \fBcmdch\fP capability)
of the loaded terminfo entries to the value of this variable.
the C compiler's name, \fBncurses\fP ignores it if it does not happen to
be a single character.
.SS BAUDRATE
-.PP
The debugging library checks this environment variable when the application
has redirected output to a file.
The variable's numeric value is used for the baudrate.
This allows testers to construct repeatable test-cases
that take into account costs that depend on baudrate.
.SS COLUMNS
-.PP
Specify the width of the screen in characters.
Applications running in a windowing environment usually are able to
obtain the width of the window in which they are executing.
Use the \fBuse_tioctl\fP function to update \fBCOLUMNS\fP or \fBLINES\fP
to match the screen size obtained from system calls or the terminal database.
.SS ESCDELAY
-.PP
Specifies the total time, in milliseconds, for which ncurses will
await a character sequence, e.g., a function key.
The default value, 1000 milliseconds, is enough for most uses.
$HOME/.terminfo
.NE
.SS LINES
-.PP
Like COLUMNS, specify the height of the screen in characters.
See COLUMNS for a detailed description.
.SS MOUSE_BUTTONS_123
-.PP
This applies only to the OS/2 EMX port.
It specifies the order of buttons on the mouse.
OS/2 numbers a 3-button mouse inconsistently from other
The variable must be three numeric digits 1\-3 in any order, e.g., 123 or 321.
If it is not specified, \fBncurses\fP uses 132.
.SS NCURSES_ASSUMED_COLORS
-.PP
Override the compiled-in assumption that the
terminal's default colors are white-on-black
(see \fBdefault_colors\fP(3X)).
explicitly saving and restoring the original screen contents.
Setting the environment variable \fBNCGDB\fP has the same effect.
.SS NCURSES_GPM_TERMS
-.PP
This applies only to ncurses configured to use the GPM interface.
.PP
If present,
If the environment variable is absent,
ncurses will attempt to open GPM if \fBTERM\fP contains \*(``linux\*(''.
.SS NCURSES_NO_HARD_TABS
-.PP
\fBNcurses\fP may use tabs as part of the cursor movement optimization.
In some cases,
your terminal driver may not handle these properly.
Set this environment variable to disable the feature.
You can also adjust your \fBstty\fP(1) settings to avoid the problem.
.SS NCURSES_NO_MAGIC_COOKIE
-.PP
Some terminals use a magic-cookie feature which requires special handling
to make highlighting and other video attributes display properly.
You can suppress the highlighting entirely for these terminals by
setting this environment variable.
.SS NCURSES_NO_PADDING
-.PP
Most of the terminal descriptions in the terminfo database are written
for real \*(``hardware\*('' terminals.
Many people use terminal emulators
standard output.
But high-level curses calls do not.
.SS NCURSES_NO_UTF8_ACS
-.PP
During initialization, the \fBncurses\fP library
checks for special cases where VT100 line-drawing (and the corresponding
alternate character set capabilities) described in the terminfo are known
to permit it to be used by applications that use ncurses'
termcap interface.
.SS NCURSES_TRACE
-.PP
During initialization, the \fBncurses\fP debugging library
checks the NCURSES_TRACE environment variable.
If it is defined, to a numeric value, \fBncurses\fP calls the \fBtrace\fP
.PP
See \fBcurs_trace\fP(3X) for more information.
.SS TERM
-.PP
Denotes your terminal type.
Each terminal type is distinct, though many are similar.
.PP
In either case, setting it directs \fBncurses\fP to ignore
the usual place for this information, e.g., /etc/termcap.
.SS TERMINFO
-.PP
\fBncurses\fP can be configured to read from multiple terminal databases.
The \fBTERMINFO\fP variable overrides the location for
the default terminal database.
@TERMINFO@ (corresponding to the TERMINFO variable)
.RE
.RE
-.PP
.SS TERMINFO_DIRS
-.PP
Specifies a list of locations to search for terminal descriptions.
Each location in the list is a terminal database as described in
the section on the \fBTERMINFO\fP variable.
There is no corresponding feature in System V terminfo;
it is an extension developed for \fBncurses\fP.
.SS TERMPATH
-.PP
If \fBTERMCAP\fP does not hold a file name then \fBncurses\fP checks
the \fBTERMPATH\fP environment variable.
This is a list of filenames separated by spaces or colons (i.e., ":") on Unix,
$TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
.NE
.SH ALTERNATE CONFIGURATIONS
-.PP
Several different configurations are possible,
depending on the configure script options used when building \fBncurses\fP.
There are a few main options whose effects are visible to the applications
the XSI Curses and \fBncurses\fP calls) are described in \fBPORTABILITY\fP
sections of the library man pages.
.SS Error checking
-.PP
In many cases, X/Open Curses is vague about error conditions,
omitting some of the SVr4 documentation.
.PP
Relying on this (or some other) extension will adversely affect the
portability of curses applications.
.SS Extensions versus portability
-.PP
Most of the extensions provided by ncurses have not been standardized.
Some have been incorporated into other implementations, such as
PDCurses or NetBSD curses.
improve the ability to manage multiple screens.
See \fBcurs_sp_funcs\fP(3X) for details.
.SS Padding differences
-.PP
In historic curses versions, delays embedded in the capabilities \fBcr\fP,
\fBind\fP, \fBcub1\fP, \fBff\fP and \fBtab\fP activated corresponding delay
bits in the UNIX tty driver.
have allowed for a special type, or (like ncurses) include <stdarg.h>
directly to provide a portable interface.
.SH NOTES
-.PP
If standard output from a \fBncurses\fP program is re-directed to something
which is not a tty, screen updates will be directed to standard error.
This was an undocumented feature of AT&T System V Release 3 curses.