]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/ncurses.3x
ncurses 6.4 - patch 20231217
[ncurses.git] / man / ncurses.3x
index c8a58fac8cbebcea4ab8988b98b5a13094d59ec9..53b83ab26875b15f1476e76f0dd9c408e8bca624 100644 (file)
@@ -28,8 +28,8 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: ncurses.3x,v 1.185 2023/12/03 00:14:35 tom Exp $
-.TH ncurses 3X 2023-12-02 "ncurses 6.4" "Library calls"
+.\" $Id: ncurses.3x,v 1.187 2023/12/17 23:44:14 tom Exp $
+.TH ncurses 3X 2023-12-17 "ncurses 6.4" "Library calls"
 .ie \n(.g \{\
 .ds `` \(lq
 .ds '' \(rq
@@ -40,6 +40,7 @@
 .ie t .ds '' ''
 .el   .ds '' ""
 .\}
+.
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
@@ -54,19 +55,20 @@ character-cell terminal interface with optimized output
 \fB#include <curses.h>
 .fi
 .SH DESCRIPTION
-The \fBncurses\fP library routines give the user a terminal-independent method
-of updating character screens with reasonable optimization.
-This implementation is \*(``new curses\*('' (ncurses) and
+The \fI\%ncurses\fP library routines give the user a
+terminal-independent method of updating character screens with
+reasonable optimization.
+This implementation is \*(``new curses\*('' (\fI\%ncurses\fP) and
 is the approved replacement for
 4.4BSD classic curses, which has been discontinued.
-This describes \fBncurses\fP
+This describes \fI\%ncurses\fP
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
 .PP
-The \fBncurses\fP library emulates the curses library of
+The \fI\%ncurses\fP library emulates the curses library of
 System V Release 4 Unix (\*(``SVr4\*(''),
 and XPG4 (X/Open Portability Guide) curses (also known as XSI curses).
 XSI stands for X/Open System Interfaces Extension.
-The \fBncurses\fP library is freely redistributable in source form.
+The \fI\%ncurses\fP library is freely redistributable in source form.
 .PP
 \fI\%ncurses\fP man pages employ several sections to clarify matters of
 usage and interoperability with other \fIcurses\fP implementations.
@@ -106,7 +108,7 @@ The ncurses_g library generates trace logs
 that describe curses actions.
 See also the section on \fBALTERNATE CONFIGURATIONS\fP.
 .PP
-The \fBncurses\fP package supports: overall screen, window and pad
+The \fI\%ncurses\fP package supports: overall screen, window and pad
 manipulation; output to windows and pads; reading terminal input; control over
 terminal and \fBcurses\fP input and output options; environment query
 routines; color manipulation; use of soft label keys; terminfo capabilities;
@@ -158,209 +160,325 @@ This can be done by executing the \fB@TPUT@ init\fP command
 after the shell environment variable \fITERM\fP has been exported.
 (The BSD-style \fB\%@TSET@\fP(1) utility also performs this function.)
 See subsection \*(``Tabs and Initialization\*('' of \fBterminfo\fP(5).
-.SS Datatypes
-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.
-A default window called \fBstdscr\fP, which is the size of the terminal
-screen, is supplied.
-Others may be created with \fBnewwin\fP.
-.PP
-Note that \fBcurses\fP does not handle overlapping windows, that's done by
-the \fBpanel\fP(3X) library.
-This means that you can either use
-\fBstdscr\fP or divide the screen into tiled windows and not using
-\fBstdscr\fP at all.
-Mixing the two will result in unpredictable, and undesired, effects.
-.PP
-Windows are referred to by variables declared as \fBWINDOW *\fP.
-These data structures are manipulated with routines described here and
-elsewhere in the \fBncurses\fP manual pages.
-Among those, the most basic
-routines are \fBmove\fP and \fBaddch\fP.
-More general versions of
-these routines are included with names beginning with \fBw\fP,
-allowing the user to specify a window.
-The routines not beginning
-with \fBw\fP affect \fBstdscr\fP.
-.PP
-After using routines to manipulate a window, \fBrefresh\fP(3X) is called,
-telling \fBcurses\fP to make the user's CRT screen look like
-\fBstdscr\fP.
-The characters in a window are actually of type
-\fBchtype\fP, (character and attribute data) so that other information
-about the character may also be stored with each character.
+.SS Overview
+A
+.I curses
+library abstracts the terminal screen by representing all or part of it
+as a
+.I \%WINDOW
+data structure.
+A
+.I window
+is a rectangular grid of character cells,
+addressed by row and column coordinates
+.RI ( y ,
+.IR x ),
+with the upper left corner as (0, 0).
+A window called \fB\%stdscr\fP,
+the same size as the terminal screen,
+is always available.
+Create others with \fB\%newwin\fP(3X).
+.PP
+A
+.I curses
+library does not manage overlapping windows.
+(See \fBpanel\fP(3X) if you desire this.)
+You can either use \fB\%stdscr\fP to manage one screen-filling window,
+or tile the screen into non-overlapping windows and not use
+\fB\%stdscr\fP at all.
+Mixing the two approaches will result in unpredictable,
+and undesired,
+effects.
+.PP
+Functions permit manipulation of a window and the
+.I cursor
+identifying the cell within it at which the next output operation will
+occur.
+Among those,
+the most basic are \fBmove\fP(3X) and \fB\%addch\fP(3X):
+these place the cursor and write a character to
+.BR \%stdscr ,
+respectively.
+As a rule,
+window-addressing functions feature names prefixed
+(or infixed,
+see below)
+with \*(``w\*('';
+these allow the user to specify a pointer to a
+.I \%WINDOW.
+Counterparts not thus prefixed
+(or infixed)
+affect \fB\%stdscr\fP.
+Because moving the cursor prior to another operation is so common,
+.I curses
+generally also provides functions with a \*(``mv\*('' prefix as a
+convenience.
+Thus,
+the library defines all of
+\fB\%addch\fP,
+\fB\%waddch\fP,
+\fB\%mvaddch\fP,
+and
+\fB\%mvwaddch\fP.
+When both prefixes are present,
+the order of arguments is a
+.I \%WINDOW
+pointer first,
+then a
+.I y
+and
+.I x
+coordinate pair.
+.PP
+Updating the terminal screen with every
+.I curses
+call can cause unpleasant flicker or inefficient use of the
+communications channel to the device.
+Therefore,
+after using
+.I curses
+functions to accumulate a set of desired updates that make sense to
+present together,
+call \fB\%refresh\fP(3X) to tell the library to make the user's screen
+look like \fBstdscr\fP.
+.I \%ncurses
+.\" X/Open Curses Issue 7 assumes some optimization will be done, but
+.\" does not mandate it in any way.
+.I optimizes
+its output by computing a minimal number of operations to mutate the
+screen from its state at the previous refresh to the new one.
+Effective optimization demands accurate information about the terminal
+device:
+the management of such information is the province of the
+\fB\%terminfo\fP(3X) API,
+a feature of every standard
+.I curses
+implementation.
 .PP
 Special windows called \fIpads\fP may also be manipulated.
-These are windows
-which are not constrained to the size of the screen and whose contents need not
-be completely displayed.
-See \fBcurs_pad\fP(3X) for more information.
-.PP
-In addition to drawing characters on the screen, video attributes and colors
-may be supported, causing the characters to show up in such modes as
-underlined, in reverse video, or in color on terminals that support such
-display enhancements.
-Line drawing characters may be specified to be output.
-On input, \fBcurses\fP is also able to translate arrow and function keys that
-transmit escape sequences into single values.
-The video attributes, line
-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
+These are windows that are not constrained to the size of the terminal
+screen and whose contents need not be completely displayed.
+See \fB\%curs_pad\fP(3X).
+.PP
+In addition to drawing characters on the screen,
+rendering attributes and colors may be supported,
+causing the characters to show up in such modes as underlined,
+in reverse video,
+or in color on terminals that support such display enhancements.
+See \fB\%curs_attr\fP(3X).
+.PP
+.I curses
+predefines symbols for a small set of line graphics characters,
+corresponding to the VT100 line drawing set.
+See
+\fB\%waddch\fP(3X) and
+\fB\%wadd_wch\fP(3X).
+.PP
+.I curses
+is implemented using the operating system's terminal driver;
+keystroke events are not received as scan codes but as byte sequences.
+Graphical keycaps
+(alphanumeric and punctuation keys,
+and the space)
+appear as-is.
+Everything else,
+including the tab,
+enter/return,
+keypad,
+arrow,
+and function keys,
+appears as a control character or a multibyte
+.I "escape sequence."
+.I curses
+translates these into unique
+.I "key codes."
+See \fB\%getch\fP(3X).
+.SS "Effects of GUIs and Environment Variables"
+The selection of an approprate value of
+.I TERM
+in the process environment is essential to correct
+.I curses
+and
+.I \%term\%info
+library operation.
+A well-configured system selects a correct
+.I TERM
+value automatically;
+\fB\%tset\fP(1) may assist with troubleshooting exotic situations.
+.PP
 If the environment variables \fILINES\fP and \fI\%COLUMNS\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.
-This would affect a program running in an AT&T 630 layer,
-for example, where the size of a
-screen is changeable (see \fBENVIRONMENT\fP).
+.I curses
+program is executing in a graphical windowing environment,
+the information obtained thence overrides that obtained by
+.IR \%term\%info .
+An
+.I \%ncurses
+extension supports resizable terminals;
+see \fB\%wresize\fP(3X).
 .PP
 If the environment variable \fI\%TERMINFO\fP is defined,
-any program using
-\fBcurses\fP checks for a local terminal definition before checking in the
-standard place.
-For example, if \fITERM\fP is set to \fBatt4424\fP, then the
-compiled terminal definition is found in
-.PP
-.RS 4
-.EX
-\fB\*d/a/att4424\fP.
-.EE
-.RE
+a
+.I curses
+program checks first for a terminal type description in the location it
+identifies.
+.I \%TERMINFO
+is useful for developing experimental type descriptions or when write
+permission to \fI\*d\fP is not available.
+.PP
+See section \*(``ENVIRONMENT\*('' below.
+.SS "Naming Conventions"
+Many
+.I curses
+functions have two or more versions.
+Those prefixed with \*(``w\*('' require a window argument.
+Four functions prefixed with \*(``p\*('' require a pad argument.
+Those without a prefix generally operate on \fB\%stdscr\fP.
+.PP
+In function synopses,
+.I \%ncurses
+man pages apply the following names to parameters.
 .PP
-(The \fBa\fP is copied from the first letter of \fBatt4424\fP to avoid
-creation of huge directories.)
-However,
-if \fI\%TERMINFO\fP is set to
-\fB$HOME/myterms\fP, \fBcurses\fP first checks
-.PP
-.RS 4
-.EX
-\fB$HOME/myterms/a/att4424\fP,
-.EE
-.RE
-.PP
-and if that fails, it then checks
-.PP
-.RS 4
-.EX
-\fB\*d/a/att4424\fP.
-.EE
-.RE
-.PP
-This is useful for developing experimental definitions or when write
-permission in \fB\*d\fP is not available.
-.PP
-The integer variables \fBLINES\fP and \fBCOLS\fP are defined in
-\fB<curses.h>\fP and will be filled in by \fBinitscr\fP with the size of the
-screen.
-The constants \fBTRUE\fP and \fBFALSE\fP have the values \fB1\fP and
-\fB0\fP, respectively.
-.PP
-The \fBcurses\fP routines also define the \fBWINDOW *\fP variable \fBcurscr\fP
-which is used for certain low-level operations like clearing and redrawing a
-screen containing garbage.
-The \fBcurscr\fP can be used in only a few routines.
-.\"
-.SS Routine and Argument Names
-Many \fBcurses\fP routines have two or more versions.
-The routines prefixed with \fIw\fP require a window argument.
-The routines prefixed with \fIp\fP require a pad argument.
-Those without a prefix generally use \fBstdscr\fP.
-.PP
-The routines prefixed with \fBmv\fP require a \fIy\fP and \fIx\fP
-coordinate to move to before performing the appropriate action.
-The \fBmv\fP routines imply a call to \fBmove\fP before the call to the
-other routine.
-The coordinate \fIy\fP always refers to the row (of
-the window), and \fIx\fP always refers to the column.
-The upper left-hand corner is always (0,0), not (1,1).
-.PP
-The routines prefixed with \fBmvw\fP take both a window argument and
-\fIx\fP and \fIy\fP coordinates.
-The window argument is always specified before the coordinates.
-.PP
-In each case, \fIwin\fP is the window affected, and \fIpad\fP is the
-pad affected; \fIwin\fP and \fIpad\fP are always pointers to type
-\fBWINDOW\fP.
-.PP
-Option setting routines require a Boolean flag \fIbf\fP with the value
-\fBTRUE\fP or \fBFALSE\fP; \fIbf\fP is always of type \fBbool\fP.
-Most of the data types used in the library routines,
-such as \fBWINDOW\fP, \fBSCREEN\fP, \fBbool\fP, and \fBchtype\fP
-are defined in \fB<curses.h>\fP.
-Types used for the terminfo routines such as
-\fBTERMINAL\fP are defined in \fB<term.h>\fP.
-.PP
-This manual page describes functions which may appear in any configuration
+.TS
+center;
+Li L.
+bf     \fIbool\fP (\fBTRUE\fP or \fBFALSE\fP)
+win    pointer to \fIWINDOW\fP
+pad    pointer to \fIWINDOW\fP that is a pad
+.TE
+.SS "Wide and Non-wide Character Configurations"
+This manual page describes functions that appear in any configuration
 of the library.
-There are two common configurations of the library:
-.RS 3
-.TP 5
-.I ncurses
-the \*(``normal\*('' library, which handles 8-bit characters.
-The normal (8-bit) library stores characters combined with attributes
-in \fBchtype\fP data.
+There are two common configurations;
+see section \*(``ALTERNATE CONFIGURATIONS\*('' below.
+.TP 10 \" "ncursesw" + 2n
+.I \%ncurses
+is the library in its \*(``non-wide\*('' configuration,
+handling only eight-bit characters.
+It stores a character combined with attributes in a
+.I \%chtype
+datum.
 .IP
-Attributes alone (no corresponding character) may be stored in \fBchtype\fP
-or the equivalent \fBattr_t\fP data.
-In either case, the data is stored in something like an integer.
+Attributes alone
+(with no corresponding character)
+can be stored in variables of
+.I \%chtype
+or
+.I \%attr_t
+type.
+In either case,
+they are represented as an integral bit mask.
 .IP
-Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBchtype\fP.
-.TP 5
-.I ncursesw
-the so-called \*(``wide\*('' library, which handles multibyte characters
-(see the section on \fBALTERNATE CONFIGURATIONS\fP).
-The \*(``wide\*('' library includes all of the calls
-from the \*(``normal\*('' library.
-It adds about one third more calls using data types which store
-multibyte characters:
-.RS 5
-.TP 5
-.B cchar_t
-corresponds to \fBchtype\fP.
-However it is a structure, because more data is stored than can fit into
-an integer.
-The characters are large enough to require a full integer value \- and there
-may be more than one character per cell.
-The video attributes and color are stored in separate fields of the structure.
+Each cell of a
+.I \%WINDOW
+is stored as a
+.I \%chtype.
+.TP 10
+.I \%ncursesw
+is the library in its \*(``wide\*('' configuration,
+which handles character encodings requiring a larger data type than
+.I \%char
+(a byte-sized type)
+can represent.
+It adds about one third more calls using additional data types that
+can store such
+.I multibyte
+characters.
+.RS 10 \" same as foregoing tag width
+.TP 9 \" "cchar_t" + 2n
+.I \%cchar_t
+corresponds to the non-wide configuration's
+.I \%chtype.
+It always a structure type,
+because it stores more data than can fit into an integer.
+A character code may be larger than can fit in a C
+.I \%char,
+and moreover more than one character may occupy a cell
+(as with accent marks and other diacritics).
+Each character is of type
+.I \%wchar_t;
+a complex character contains one spacing character and zero or more
+non-spacing characters
+(see below).
+Attributes and color data are stored in separate fields of the
+structure,
+not combined as in
+.I \%chtype.
 .IP
-Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBcchar_t\fP.
-.IP
-The \fBsetcchar\fP(3X) and \fBgetcchar\fP(3X)
-functions store and retrieve the data from
-a \fBcchar_t\fP structure.
-.TP 5
-.B wchar_t
-stores a \*(``wide\*('' character.
-Like \fBchtype\fP, this may be an integer.
-.TP 5
-.B wint_t
-stores a \fBwchar_t\fP or \fBWEOF\fP \- not the same, though both may have
-the same size.
+Each cell
+(row and column)
+.I \%WINDOW
+is stored as a
+.I \%cchar_t.
+.PP
+The \fB\%setcchar\fP(3X) and \fB\%getcchar\fP(3X)
+functions store and retrieve the data from a
+.I \%cchar_t
+structure.
+The wide library API of
+.I \%ncurses
+depends on two data types standardized by ISO C95.
+.TP 9
+.I \%wchar_t
+stores a wide character.
+Like
+.I \%chtype,
+this may be an integer.
+Depending on the character encoding,
+a wide character may be
+.I spacing,
+meaning that it occupies a character cell by itself and typically
+accompanies cursor advancement on input,
+or
+.I combining,
+meaning that it occupies the same cell as a spacing character,
+is often regarded as a \*(``modifier\*('' of the base glyph with which
+it combines,
+and typically does not advance the cursor on input.
+.TP 9
+.I \%wint_t
+can store a
+.I \%wchar_t
+or the constant
+.BR \%WEOF ,
+analogously to the
+.IR int -sized
+character manipulation functions of ISO C and their constant
+.BR \%EOF .
 .RE
 .IP
-The \*(``wide\*('' library provides new functions which are analogous to
-functions in the \*(``normal\*('' library.
-There is a naming convention which relates many of the normal/wide variants:
-a \*(``_w\*('' is inserted into the name.
-For example, \fBwaddch\fP becomes \fBwadd_wch\fP.
-.RE
+The wide library provides additional functions that complement those in
+the non-wide library where the size of the underlying character type is
+significant.
+A somewhat regular naming convention relates many of the wide variants
+to their non-wide counterparts;
+where a non-wide function name contains \*(``ch\*('' or \*(``str\*('',
+prefix it with \*(``_w\*('' to obtain the wide counterpart.
+For example,
+\fB\%waddch\fP becomes \fB\%wadd_wch\fP.
+.IP
+This convention is inapplicable to some non-wide function names,
+so other transformations are used for the wide configuration:
+in the window background management functions,
+\*(``bkgd\*('' becomes \*(``bkgrnd\*('';
+the window border-drawing and -clearing functions are suffixed with
+\*(``_set\*(''.
 .\"
-.SS Routine Name Index
-The following table lists the \fBcurses\fP routines provided in
-the \*(``normal\*('' and \*(``wide\*('' libraries and the names of
-the manual pages on which they are described.
-Routines flagged with \*(``*\*(''
-are ncurses-specific, not described by XPG4 or present in SVr4.
+.SS "Function Name Index"
+The following table lists the
+.I curses
+functions provided in the non-wide and wide APIs and the corresponding
+man pages that describe them.
+Those flagged with \*(``*\*(''
+are
+.IR \%ncurses -specific,
+neither described by X/Open Curses nor present in SVr4.
 .PP
 .TS
 center tab(/);
-l l
 l l .
-\fBcurses\fP Routine Name/Manual Page Name
-=
+\f(BIcurses\fP Function Name/Man Page
+_
 COLOR_PAIR/\fBcurs_color\fP(3X)
 PAIR_NUMBER/\fBcurs_attr\fP(3X)
 add_wch/\fBcurs_add_wch\fP(3X)
@@ -844,17 +962,21 @@ The return values of
 \fBgetmaxyx\fP are undefined (i.e., these should not be used as the
 right-hand side of assignment statements).
 .PP
-Functions with a \*(``mv\*('' prefix first perform a cursor movement using
-\fBwmove\fP, and return an error if the position is outside the window,
-or if the window pointer is null.
+Functions with a \*(``mv\*('' prefix first perform cursor movement using
+\fB\%wmove\fP and return an error if the position is outside the window,
+or
+(for \*(``mvw\*('' functions)
+if the
+.I \%WINDOW
+pointer is null.
 Most \*(``mv\*(''-prefixed functions
-(except variadic functions such as \fBmvprintw\fP)
+(except variadic functions such as \fB\%mvprintw\fP)
 are provided both as macros and functions.
 .PP
 Routines that return pointers return \fBNULL\fP on error.
 .SH ENVIRONMENT
 The following environment symbols are useful for customizing the
-runtime behavior of the \fBncurses\fP library.
+runtime behavior of the \fI\%ncurses\fP library.
 The most important ones have been already discussed in detail.
 .SS \fICC\fP command-character
 When set, change occurrences of the command_character
@@ -863,13 +985,14 @@ of the loaded terminfo entries to the value of this variable.
 Very few terminfo entries provide this feature.
 .PP
 Because this name is also used in development environments to represent
-the C compiler's name, \fBncurses\fP ignores it if it does not happen to
-be a single character.
+the C compiler's name,
+\fI\%ncurses\fP ignores it if it does not happen to be a single
+character.
 .SS \fIBAUDRATE\fP
 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.
-If no value is found, \fBncurses\fP uses 9600.
+If no value is found, \fI\%ncurses\fP uses 9600.
 This allows testers to construct repeatable test-cases
 that take into account costs that depend on baudrate.
 .SS \fICOLUMNS\fP
@@ -877,7 +1000,8 @@ 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.
 If neither the \fI\%COLUMNS\fP value nor the terminal's screen size is available,
-\fBncurses\fP uses the size which may be specified in the terminfo database
+\fI\%ncurses\fP uses the size which may be specified in the terminfo
+database
 (i.e., the \fBcols\fP capability).
 .PP
 It is important that your application use a correct size for the screen.
@@ -901,8 +1025,11 @@ Use the \fBuse_tioctl\fP function to update \fI\%COLUMNS\fP or
 \fILINES\fP to match the screen size obtained from system calls or the
 terminal database.
 .SS \fIESCDELAY\fP
-Specifies the total time, in milliseconds, for which ncurses will
-await a character sequence, e.g., a function key.
+Specifies the total time,
+in milliseconds,
+for which \fI\%ncurses\fP will await a character sequence,
+e.g.,
+a function key.
 The default value, 1000 milliseconds, is enough for most uses.
 However, it is made a variable to accommodate unusual applications.
 .PP
@@ -925,7 +1052,7 @@ in either form,
 but setting the environment variable rather than the global variable
 does not create problems when compiling an application.
 .SS \fIHOME\fP
-Tells \fBncurses\fP where your home directory is.
+Tells \fI\%ncurses\fP where your home directory is.
 That is where it may read and write auxiliary terminal descriptions:
 .PP
 .RS 4
@@ -953,19 +1080,19 @@ platforms:
 .PP
 This variable lets you customize the mouse.
 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.
+If it is not specified, \fI\%ncurses\fP uses 132.
 .SS \fINCURSES_ASSUMED_COLORS\fP
 Override the compiled-in assumption that the
 terminal's default colors are white-on-black
 (see \fBdefault_colors\fP(3X)).
 You may set the foreground and background color values with this environment
 variable by proving a 2-element list: foreground,background.
-For example, to tell ncurses to not assume anything
+For example, to tell \fI\%ncurses\fP to not assume anything
 about the colors, set this to "\-1,\-1".
 To make it green-on-black, set it to "2,0".
 Any positive value from zero to the terminfo \fBmax_colors\fP value is allowed.
 .SS \fINCURSES_CONSOLE2\fP
-This applies only to the MinGW port of ncurses.
+This applies only to the MinGW port of \fI\%ncurses\fP.
 .PP
 The \fBConsole2\fP program's handling of the Microsoft Console API call
 \fBCreateConsoleScreenBuffer\fP is defective.
@@ -975,7 +1102,8 @@ mapping coordinates,
 explicitly saving and restoring the original screen contents.
 Setting the environment variable \fBNCGDB\fP has the same effect.
 .SS \fINCURSES_GPM_TERMS\fP
-This applies only to ncurses configured to use the GPM interface.
+This applies only to \fI\%ncurses\fP configured to use the GPM
+interface.
 .PP
 If present,
 the environment variable is a list of one or more terminal names
@@ -984,18 +1112,19 @@ Setting it to an empty value disables the GPM interface;
 using the built-in support for xterm, etc.
 .PP
 If the environment variable is absent,
-ncurses will attempt to open GPM if \fITERM\fP contains \*(``linux\*(''.
+\fI\%ncurses\fP will attempt to open GPM if \fITERM\fP contains
+\*(``linux\*(''.
 .SS \fINCURSES_NO_HARD_TABS\fP
-\fBNcurses\fP may use tabs as part of the cursor movement optimization.
+\fI\%ncurses\fP may use tabs as part of cursor movement optimization.
 In some cases,
 your terminal driver may not handle these properly.
-Set this environment variable to disable the feature.
+Set this environment variable to any value to disable the feature.
 You can also adjust your \fBstty\fP(1) settings to avoid the problem.
 .SS \fINCURSES_NO_MAGIC_COOKIE\fP
 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.
+setting this environment variable to any value.
 .SS \fINCURSES_NO_PADDING\fP
 Most of the terminal descriptions in the terminfo database are written
 for real \*(``hardware\*('' terminals.
@@ -1034,38 +1163,39 @@ continued
 though 5.9 patch 20130126
 .RE
 .PP
-\fBncurses\fP enabled buffered output during terminal initialization.
+\fI\%ncurses\fP enabled buffered output during terminal initialization.
 This was done (as in SVr4 curses) for performance reasons.
-For testing purposes, both of \fBncurses\fP and certain applications,
+For testing purposes, both of \fI\%ncurses\fP and certain applications,
 this feature was made optional.
 Setting the \fI\%NCURSES_NO_SETBUF\fP variable
 disabled output buffering, leaving the output in the original (usually
 line buffered) mode.
 .PP
 In the current implementation,
-ncurses performs its own buffering and does not require this workaround.
+\fI\%ncurses\fP performs its own buffering and does not require this
+workaround.
 It does not modify the buffering of the standard output.
 .PP
 The reason for the change was to make the behavior for interrupts and
 other signals more robust.
 One drawback is that certain nonconventional programs would mix
-ordinary stdio calls with ncurses calls and (usually) work.
-This is no longer possible since ncurses is not using
+ordinary stdio calls with \fI\%ncurses\fP calls and (usually) work.
+This is no longer possible since \fI\%ncurses\fP is not using
 the buffered standard output but its own output (to the same file descriptor).
 As a special case, the low-level calls such as \fBputp\fP still use the
 standard output.
 But high-level curses calls do not.
 .SS \fINCURSES_NO_UTF8_ACS\fP
-During initialization, the \fBncurses\fP library
+During initialization, the \fI\%ncurses\fP library
 checks for special cases where VT100 line-drawing (and the corresponding
 alternate character set capabilities) described in the terminfo are known
 to be missing.
 Specifically, when running in a UTF\-8 locale,
 the Linux console emulator and the GNU screen program ignore these.
-Ncurses checks the \fITERM\fP environment variable for these.
+\fI\%ncurses checks the \fITERM\fP environment variable for these.
 For other special cases, you should set this environment variable.
-Doing this tells ncurses to use Unicode values which correspond to
-the VT100 line-drawing glyphs.
+Doing this tells \fI\%ncurses\fP to use Unicode values which correspond
+to the VT100 line-drawing glyphs.
 That works for the special cases cited,
 and is likely to work for terminal emulators.
 .PP
@@ -1074,7 +1204,7 @@ Setting it to zero (or to a nonnumber)
 disables the special check for \*(``linux\*('' and \*(``screen\*(''.
 .PP
 As an alternative to the environment variable,
-ncurses checks for an extended terminfo capability \fBU8\fP.
+\fI\%ncurses\fP checks for an extended terminfo capability \fBU8\fP.
 This is a numeric capability which can be compiled using \fB@TIC@\ \-x\fP.
 For example
 .PP
@@ -1092,13 +1222,15 @@ xterm\-utf8|xterm relying on UTF\-8 line\-graphics,
 .RE
 .PP
 The name \*(``U8\*('' is chosen to be two characters,
-to permit it to be used by applications that use ncurses'
+to permit it to be used by applications that use \fI\%ncurses\fP'
 termcap interface.
 .SS \fINCURSES_TRACE\fP
-During initialization, the \fBncurses\fP debugging library
+During initialization, the \fI\%ncurses\fP debugging library
 checks the \fI\%NCURSES_TRACE\fP environment variable.
-If it is defined, to a numeric value, \fBncurses\fP calls the \fBtrace\fP
-function, using that value as the argument.
+If it is defined,
+to a numeric value,
+\fI\%ncurses\fP calls the \fBtrace\fP function,
+using that value as the argument.
 .PP
 The argument values, which are defined in \fBcurses.h\fP, provide several
 types of information.
@@ -1125,18 +1257,19 @@ terminal emulators which allow you to
 specify \fITERM\fP as a parameter or configuration value do
 not change their behavior to match that setting.
 .SS \fITERMCAP\fP
-If the \fBncurses\fP library has been configured with \fItermcap\fP
-support, \fBncurses\fP will check for a terminal's description in
+If the \fI\%ncurses\fP library has been configured with \fItermcap\fP
+support, \fI\%ncurses\fP will check for a terminal's description in
 termcap form if it is not available in the terminfo database.
 .PP
 The \fI\%TERMCAP\fP environment variable contains
 either a terminal description (with newlines stripped out),
 or a file name telling where the information denoted by
 the \fITERM\fP environment variable exists.
-In either case, setting it directs \fBncurses\fP to ignore
+In either case, setting it directs \fI\%ncurses\fP to ignore
 the usual place for this information, e.g., /etc/termcap.
 .SS \fITERMINFO\fP
-\fBncurses\fP can be configured to read from multiple terminal databases.
+\fI\%ncurses\fP can be configured to read from multiple terminal
+databases.
 The \fI\%TERMINFO\fP variable overrides the location for
 the default terminal database.
 Terminal descriptions (in terminal format) are stored in terminal databases:
@@ -1149,7 +1282,7 @@ and the \fI\%TERMINFO\fP variable is used by \fIcurses\fP applications
 on those
 systems to override the default location of the terminal database.
 .IP \(bu 4
-If \fBncurses\fP is built to use hashed databases,
+If \fI\%ncurses\fP is built to use hashed databases,
 then each entry in this list may be the path of a hashed database file, e.g.,
 .RS 4
 .PP
@@ -1175,13 +1308,13 @@ reading it directly
 rather than using the terminfo library calls.
 .RE
 .bP
-If \fBncurses\fP is built with a support for reading termcap files
+If \fI\%ncurses\fP is built with a support for reading termcap files
 directly, then an entry in this list may be the path of a termcap file.
 .IP \(bu 4
 If the \fI\%TERMINFO\fP variable begins with
 \*(``hex:\*('' or \*(``b64:\*('',
-\fBncurses\fP uses the remainder of that variable as a compiled terminal
-description.
+\fI\%ncurses\fP uses the remainder of that variable as a compiled
+terminal description.
 You might produce the base64 format using \fBinfocmp\fP(1M):
 .RS 4
 .PP
@@ -1201,7 +1334,7 @@ but not the only way to set location of the default terminal database.
 The complete list of database locations in order follows:
 .RS 3
 .bP
-the last terminal database to which \fBncurses\fP wrote,
+the last terminal database to which \fI\%ncurses\fP wrote,
 if any, is searched first
 .bP
 the location specified by the \fI\%TERMINFO\fP environment variable
@@ -1211,7 +1344,7 @@ $HOME/.terminfo
 locations listed in the \fI\%TERMINFO_DIRS\fP environment variable
 .bP
 one or more locations whose names are configured and compiled into the
-ncurses library, i.e.,
+\fI\%ncurses\fP library, i.e.,
 .RS 3
 .bP
 @TERMINFO_DIRS@ (corresponding to the \fI\%TERMINFO_DIRS\fP variable)
@@ -1226,15 +1359,15 @@ the section on the \fI\%TERMINFO\fP variable.
 The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
 .PP
 There is no corresponding feature in System V terminfo;
-it is an extension developed for \fBncurses\fP.
+it is an extension developed for \fI\%ncurses\fP.
 .SS \fITERMPATH\fP
-If \fI\%TERMCAP\fP does not hold a file name then \fBncurses\fP checks
+If \fI\%TERMCAP\fP does not hold a file name then \fI\%ncurses\fP checks
 the \fI\%TERMPATH\fP environment variable.
 This is a list of filenames separated by spaces or colons (i.e., ":") on Unix,
 semicolons on OS/2 EMX.
 .PP
 If the \fI\%TERMPATH\fP environment variable is not set,
-\fBncurses\fP looks in the files
+\fI\%ncurses\fP looks in the files
 .PP
 .RS 4
 .EX
@@ -1255,12 +1388,13 @@ $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
 .RE
 .SH ALTERNATE CONFIGURATIONS
 Several different configurations are possible,
-depending on the configure script options used when building \fBncurses\fP.
+depending on the configure script options used when building
+\fI\%ncurses\fP.
 There are a few main options whose effects are visible to the applications
-developer using \fBncurses\fP:
+developer using \fI\%ncurses\fP:
 .TP 5
 \-\-disable\-overwrite
-The standard include for \fBncurses\fP is as noted in \fBSYNOPSIS\fP:
+The standard include for \fI\%ncurses\fP is as noted in \fBSYNOPSIS\fP:
 .RS 5
 .PP
 .RS 4
@@ -1269,10 +1403,11 @@ The standard include for \fBncurses\fP is as noted in \fBSYNOPSIS\fP:
 .EE
 .RE
 .PP
-This option is used to avoid filename conflicts when \fBncurses\fP
+This option is used to avoid filename conflicts when \fI\%ncurses\fP
 is not the main implementation of curses of the computer.
-If \fBncurses\fP is installed disabling overwrite, it puts its headers in
-a subdirectory, e.g.,
+If \fI\%ncurses\fP is installed disabling overwrite,
+it puts its headers in a subdirectory,
+e.g.,
 .PP
 .RS 4
 .EX
@@ -1327,10 +1462,10 @@ with the caveat that some other header file than \fBcurses.h\fP
 may require a specific value for \fB_XOPEN_SOURCE\fP
 (or a system-specific symbol).
 .PP
-The \fBcurses.h\fP file which is installed for the wide-character
-library is designed to be compatible with the normal library's header.
-Only the size of the \fBWINDOW\fP structure differs, and very few
-applications require more than a pointer to \fBWINDOW\fPs.
+The \fI\%curses.h\fP header file installed for the wide-character
+library is designed to be compatible with the non-wide library's header.
+Only the size of the \fI\%WINDOW\fP structure differs;
+few applications require more than pointers to \fI\%WINDOW\fPs.
 .PP
 If the headers are installed allowing overwrite,
 the wide-character library's headers should be installed last,
@@ -1400,58 +1535,64 @@ tab stop initialization database
 .I \*d
 compiled terminal capability database
 .SH NOTES
-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.
+If standard output from a \fI\%ncurses\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.
 .PP
 See subsection \*(``Header files\*('' below regarding symbols exposed by
 inclusion of \fI\%curses.h\fP.
 .SH EXTENSIONS
-The \fBncurses\fP library can be compiled with an option (\fB\-DUSE_GETCAP\fP)
+The \fI\%ncurses\fP library can be compiled with an option
+(\fB\-DUSE_GETCAP\fP)
 that falls back to the old-style /etc/termcap file if the terminal setup code
 cannot find a terminfo entry corresponding to \fITERM\fP.
-Use of this feature
-is not recommended, as it essentially includes an entire termcap compiler in
-the \fBncurses\fP startup code, at significant cost in core and startup cycles.
-.PP
-The \fBncurses\fP library includes facilities for capturing mouse events on
-certain terminals (including xterm).
+Use of this feature is not recommended,
+as it essentially includes an entire termcap compiler in the
+\fI\%ncurses\fP startup code,
+at significant cost in core and startup cycles.
+.PP
+The \fI\%ncurses\fP library includes facilities for capturing mouse
+events on certain terminals
+(including xterm).
 See the \fBcurs_mouse\fP(3X)
 manual page for details.
 .PP
-The \fBncurses\fP library includes facilities for responding to window
+The \fI\%ncurses\fP library includes facilities for responding to window
 resizing events, e.g., when running in an xterm.
 See the \fBresizeterm\fP(3X)
 and \fBwresize\fP(3X) manual pages for details.
 In addition, the library may be configured with a \fBSIGWINCH\fP handler.
 .PP
-The \fBncurses\fP library extends the fixed set of function key capabilities
-of terminals by allowing the application designer to define additional
-key sequences at runtime.
+The \fI\%ncurses\fP library extends the fixed set of function key
+capabilities of terminals by allowing the application designer to define
+additional key sequences at runtime.
 See the \fBdefine_key\fP(3X)
 \fBkey_defined\fP(3X),
 and \fBkeyok\fP(3X) manual pages for details.
 .PP
-The \fBncurses\fP library can exploit the capabilities of terminals which
-implement the ISO\-6429 SGR 39 and SGR 49 controls, which allow an application
-to reset the terminal to its original foreground and background colors.
+The \fI\%ncurses\fP library can exploit the capabilities of terminals
+which implement the ISO\-6429 SGR 39 and SGR 49 controls,
+which allow an application to reset the terminal to its original
+foreground and background colors.
 From the users' perspective, the application is able to draw colored
 text on a background whose color is set independently, providing better
 control over color contrasts.
 See the \fBdefault_colors\fP(3X) manual page for details.
 .PP
-The \fBncurses\fP library includes a function for directing application output
-to a printer attached to the terminal device.
+The \fI\%ncurses\fP library includes a function for directing
+application output to a printer attached to the terminal device.
 See the \fBcurs_print\fP(3X) manual page for details.
 .SH PORTABILITY
-The \fBncurses\fP library is intended to be BASE-level conformant with XSI
-Curses.
+The \fI\%ncurses\fP library is intended to be BASE-level conformant with
+XSI Curses.
 The EXTENDED XSI Curses functionality
 (including color support) is supported.
 .PP
-A small number of local differences (that is, individual differences between
-the XSI Curses and \fBncurses\fP calls) are described in \fBPORTABILITY\fP
-sections of the library man pages.
+A small number of local differences
+(that is,
+individual differences between the XSI Curses and \fI\%ncurses\fP calls)
+are described in \fBPORTABILITY\fP sections of the library man pages.
 .SS Error checking
 In many cases, X/Open Curses is vague about error conditions,
 omitting some of the SVr4 documentation.
@@ -1465,7 +1606,8 @@ to tell an application which of several possible errors were detected.
 Relying on this (or some other) extension will adversely affect the
 portability of curses applications.
 .SS Extensions versus portability
-Most of the extensions provided by ncurses have not been standardized.
+Most of the extensions provided by \fI\%ncurses\fP have not been
+standardized.
 Some have been incorporated into other implementations, such as
 PDCurses or NetBSD curses.
 Here are a few to consider:
@@ -1523,7 +1665,9 @@ Here is a more complete story:
 Starting with BSD curses, all implementations have included <stdio.h>.
 .IP
 BSD curses included <curses.h> and <unctrl.h> from an internal header
-"curses.ext" ("ext" was a short name for \fIexterns\fP).
+file
+.I \%curses.ext
+(\*(``ext\*('' abbreviated \*(``externs\*('').
 .IP
 BSD curses used <stdio.h> internally (for \fBprintw\fP and \fBscanw\fP),
 but nothing in <curses.h> itself relied upon <stdio.h>.
@@ -1543,17 +1687,18 @@ As a result, standard <curses.h> will always include <stdio.h>.
 .bP
 X/Open Curses is inconsistent with respect to SVr4 regarding <unctrl.h>.
 .IP
-As noted in \fBcurs_util\fP(3X), ncurses includes <unctrl.h> from
-<curses.h> (like SVr4).
+As noted in \fBcurs_util\fP(3X),
+\fI\%ncurses\fP includes <unctrl.h> from <curses.h>
+(like SVr4).
 .bP
 X/Open's comments about <term.h> and <termios.h> may refer to HP-UX and AIX:
 .IP
 HP-UX curses includes <term.h> from <curses.h>
 to declare \fBsetupterm\fP in curses.h,
-but ncurses (and Solaris curses) do not.
+but \fI\%ncurses\fP (and Solaris curses) do not.
 .IP
 AIX curses includes <term.h> and <termios.h>.
-Again, ncurses (and Solaris curses) do not.
+Again, \fI\%ncurses\fP (and Solaris curses) do not.
 .bP
 X/Open says that <curses.h> \fImay\fP include <term.h>,
 but there is no requirement that it do that.
@@ -1563,17 +1708,17 @@ and must include both headers in the same module.
 Very old versions of AIX curses required including <curses.h>
 before including <term.h>.
 .IP
-Because ncurses header files include the headers needed to
+Because \fI\%ncurses\fP header files include the headers needed to
 define datatypes used in the headers,
-ncurses header files can be included in any order.
+\fI\%ncurses\fP header files can be included in any order.
 But for portability, you should include <curses.h> before <term.h>.
 .bP
 X/Open Curses says \fI"may make visible"\fP
 because including a header file does not necessarily make all symbols
 in it visible (there are ifdef's to consider).
 .IP
-For instance, in ncurses <wchar.h> \fImay\fP be included if
-the proper symbol is defined, and if ncurses is configured for
+For instance, in \fI\%ncurses\fP <wchar.h> \fImay\fP be included if
+the proper symbol is defined, and if \fI\%ncurses\fP is configured for
 wide-character support.
 If the header is included, its symbols may be made visible.
 That depends on the value used for \fB_XOPEN_SOURCE\fP
@@ -1599,8 +1744,10 @@ because <stdio.h> is always included by <curses.h>.
 .IP
 None of the X/Open Curses implementations require an application
 to include <stdarg.h> before <curses.h> because they either
-have allowed for a special type, or (like ncurses) include <stdarg.h>
-directly to provide a portable interface.
+have allowed for a special type,
+or
+(like \fI\%ncurses\fP)
+include <stdarg.h> directly to provide a portable interface.
 .SH AUTHORS
 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
 Based on \fIpcurses\fP by Pavel Curtis.