Deleted Added
full compact
ncurses.3x (166124) ncurses.3x (174993)
1'\" t
2.\"***************************************************************************
1'\" t
2.\"***************************************************************************
3.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
3.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
4.\" *
5.\" Permission is hereby granted, free of charge, to any person obtaining a *
6.\" copy of this software and associated documentation files (the *
7.\" "Software"), to deal in the Software without restriction, including *
8.\" without limitation the rights to use, copy, modify, merge, publish, *
9.\" distribute, distribute with modifications, sublicense, and/or sell *
10.\" copies of the Software, and to permit persons to whom the Software is *
11.\" furnished to do so, subject to the following conditions: *

--- 10 unchanged lines hidden (view full) ---

22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23.\" *
24.\" Except as contained in this notice, the name(s) of the above copyright *
25.\" holders shall not be used in advertising or otherwise to promote the *
26.\" sale, use or other dealings in this Software without prior written *
27.\" authorization. *
28.\"***************************************************************************
29.\"
4.\" *
5.\" Permission is hereby granted, free of charge, to any person obtaining a *
6.\" copy of this software and associated documentation files (the *
7.\" "Software"), to deal in the Software without restriction, including *
8.\" without limitation the rights to use, copy, modify, merge, publish, *
9.\" distribute, distribute with modifications, sublicense, and/or sell *
10.\" copies of the Software, and to permit persons to whom the Software is *
11.\" furnished to do so, subject to the following conditions: *

--- 10 unchanged lines hidden (view full) ---

22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23.\" *
24.\" Except as contained in this notice, the name(s) of the above copyright *
25.\" holders shall not be used in advertising or otherwise to promote the *
26.\" sale, use or other dealings in this Software without prior written *
27.\" authorization. *
28.\"***************************************************************************
29.\"
30.\" $Id: ncurses.3x,v 1.81 2006/12/02 19:23:11 tom Exp $
30.\" $Id: ncurses.3x,v 1.89 2007/09/01 18:57:29 tom Exp $
31.hy 0
32.TH ncurses 3X ""
33.ds n 5
34.ds d @TERMINFO@
35.SH NAME
36\fBncurses\fR - CRT screen handling and optimization package
37.SH SYNOPSIS
38\fB#include <curses.h>\fR
39.br
40.SH DESCRIPTION
41The \fBncurses\fR library routines give the user a terminal-independent method
31.hy 0
32.TH ncurses 3X ""
33.ds n 5
34.ds d @TERMINFO@
35.SH NAME
36\fBncurses\fR - CRT screen handling and optimization package
37.SH SYNOPSIS
38\fB#include <curses.h>\fR
39.br
40.SH DESCRIPTION
41The \fBncurses\fR library routines give the user a terminal-independent method
42of updating character screens with reasonable optimization. This
43implementation is ``new curses'' (ncurses) and is the approved replacement for
42of updating character screens with reasonable optimization.
43This implementation is ``new curses'' (ncurses) and
44is the approved replacement for
444.4BSD classic curses, which has been discontinued.
45This describes \fBncurses\fR
46version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
47.PP
454.4BSD classic curses, which has been discontinued.
46This describes \fBncurses\fR
47version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
48.PP
48The \fBncurses\fR routines emulate the \fBcurses\fR(3X) library of System V
49Release 4 UNIX, and the XPG4 curses standard (XSI curses) but the \fBncurses\fR
50library is freely redistributable in source form. Differences from the SVr4
49The \fBncurses\fR library emulates the \fBcurses\fR(3X) library of
50System V Release 4 UNIX,
51and XPG4 (X/Open Portability Guide) curses (also known as XSI curses).
52XSI stands for X/Open System Interfaces Extension.
53The \fBncurses\fR library is freely redistributable in source form.
54Differences from the SVr4
51curses are summarized under the \fBEXTENSIONS\fP and \fBPORTABILITY\fP sections below and
52described in detail in the respective \fBEXTENSIONS\fP, \fBPORTABILITY\fP and \fBBUGS\fP sections
53of individual man pages.
54.PP
55curses are summarized under the \fBEXTENSIONS\fP and \fBPORTABILITY\fP sections below and
56described in detail in the respective \fBEXTENSIONS\fP, \fBPORTABILITY\fP and \fBBUGS\fP sections
57of individual man pages.
58.PP
59The \fBncurses\fR library also provides many useful extensions,
60i.e., features which cannot be implemented by a simple add-on library
61but which require access to the internals of the library.
62.PP
55A program using these routines must be linked with the \fB-lncurses\fR option,
56or (if it has been generated) with the debugging library \fB-lncurses_g\fR.
57(Your system integrator may also have installed these libraries under
58the names \fB-lcurses\fR and \fB-lcurses_g\fR.)
59The ncurses_g library generates trace logs (in a file called 'trace' in the
60current directory) that describe curses actions.
61See also the section on \fBALTERNATE CONFIGURATIONS\fP.
62.PP
63The \fBncurses\fR package supports: overall screen, window and pad
64manipulation; output to windows and pads; reading terminal input; control over
65terminal and \fBcurses\fR input and output options; environment query
66routines; color manipulation; use of soft label keys; terminfo capabilities;
67and access to low-level terminal-manipulation routines.
68.PP
69To initialize the routines, the routine \fBinitscr\fR or \fBnewterm\fR
70must be called before any of the other routines that deal with windows
63A program using these routines must be linked with the \fB-lncurses\fR option,
64or (if it has been generated) with the debugging library \fB-lncurses_g\fR.
65(Your system integrator may also have installed these libraries under
66the names \fB-lcurses\fR and \fB-lcurses_g\fR.)
67The ncurses_g library generates trace logs (in a file called 'trace' in the
68current directory) that describe curses actions.
69See also the section on \fBALTERNATE CONFIGURATIONS\fP.
70.PP
71The \fBncurses\fR package supports: overall screen, window and pad
72manipulation; output to windows and pads; reading terminal input; control over
73terminal and \fBcurses\fR input and output options; environment query
74routines; color manipulation; use of soft label keys; terminfo capabilities;
75and access to low-level terminal-manipulation routines.
76.PP
77To initialize the routines, the routine \fBinitscr\fR or \fBnewterm\fR
78must be called before any of the other routines that deal with windows
71and screens are used. The routine \fBendwin\fR must be called before
72exiting. To get character-at-a-time input without echoing (most
79and screens are used.
80The routine \fBendwin\fR must be called before exiting.
81To get character-at-a-time input without echoing (most
73interactive, screen oriented programs want this), the following
74sequence should be used:
75.sp
76 \fBinitscr(); cbreak(); noecho();\fR
77.sp
78Most programs would additionally use the sequence:
79.sp
80 \fBnonl();\fR
81 \fBintrflush(stdscr, FALSE);\fR
82 \fBkeypad(stdscr, TRUE);\fR
83.sp
84Before a \fBcurses\fR program is run, the tab stops of the terminal
82interactive, screen oriented programs want this), the following
83sequence should be used:
84.sp
85 \fBinitscr(); cbreak(); noecho();\fR
86.sp
87Most programs would additionally use the sequence:
88.sp
89 \fBnonl();\fR
90 \fBintrflush(stdscr, FALSE);\fR
91 \fBkeypad(stdscr, TRUE);\fR
92.sp
93Before a \fBcurses\fR program is run, the tab stops of the terminal
85should be set and its initialization strings, if defined, must be
86output. This can be done by executing the \fBtput init\fR command
94should be set and its initialization strings, if defined, must be output.
95This can be done by executing the \fBtput init\fR command
87after the shell environment variable \fBTERM\fR has been exported.
88\fBtset(1)\fR is usually responsible for doing this.
89[See \fBterminfo\fR(\*n) for further details.]
90.PP
91The \fBncurses\fR library permits manipulation of data structures,
92called \fIwindows\fR, which can be thought of as two-dimensional
96after the shell environment variable \fBTERM\fR has been exported.
97\fBtset(1)\fR is usually responsible for doing this.
98[See \fBterminfo\fR(\*n) for further details.]
99.PP
100The \fBncurses\fR library permits manipulation of data structures,
101called \fIwindows\fR, which can be thought of as two-dimensional
93arrays of characters representing all or part of a CRT screen. A
94default window called \fBstdscr\fR, which is the size of the terminal
95screen, is supplied. Others may be created with \fBnewwin\fR.
102arrays of characters representing all or part of a CRT screen.
103A default window called \fBstdscr\fR, which is the size of the terminal
104screen, is supplied.
105Others may be created with \fBnewwin\fR.
96.PP
97Note that \fBcurses\fR does not handle overlapping windows, that's done by
106.PP
107Note that \fBcurses\fR does not handle overlapping windows, that's done by
98the \fBpanel\fR(3X) library. This means that you can either use
108the \fBpanel\fR(3X) library.
109This means that you can either use
99\fBstdscr\fR or divide the screen into tiled windows and not using
110\fBstdscr\fR or divide the screen into tiled windows and not using
100\fBstdscr\fR at all. Mixing the two will result in unpredictable, and
101undesired, effects.
111\fBstdscr\fR at all.
112Mixing the two will result in unpredictable, and undesired, effects.
102.PP
103Windows are referred to by variables declared as \fBWINDOW *\fR.
104These data structures are manipulated with routines described here and
113.PP
114Windows are referred to by variables declared as \fBWINDOW *\fR.
115These data structures are manipulated with routines described here and
105elsewhere in the \fBncurses\fR manual pages. Among those, the most basic
106routines are \fBmove\fR and \fBaddch\fR. More general versions of
116elsewhere in the \fBncurses\fR manual pages.
117Among those, the most basic
118routines are \fBmove\fR and \fBaddch\fR.
119More general versions of
107these routines are included with names beginning with \fBw\fR,
120these routines are included with names beginning with \fBw\fR,
108allowing the user to specify a window. The routines not beginning
121allowing the user to specify a window.
122The routines not beginning
109with \fBw\fR affect \fBstdscr\fR.
110.PP
111After using routines to manipulate a window, \fBrefresh\fR is called,
112telling \fBcurses\fR to make the user's CRT screen look like
123with \fBw\fR affect \fBstdscr\fR.
124.PP
125After using routines to manipulate a window, \fBrefresh\fR is called,
126telling \fBcurses\fR to make the user's CRT screen look like
113\fBstdscr\fR. The characters in a window are actually of type
127\fBstdscr\fR.
128The characters in a window are actually of type
114\fBchtype\fR, (character and attribute data) so that other information
115about the character may also be stored with each character.
116.PP
129\fBchtype\fR, (character and attribute data) so that other information
130about the character may also be stored with each character.
131.PP
117Special windows called \fIpads\fR may also be manipulated. These are windows
132Special windows called \fIpads\fR may also be manipulated.
133These are windows
118which are not constrained to the size of the screen and whose contents need not
134which are not constrained to the size of the screen and whose contents need not
119be completely displayed. See \fBcurs_pad\fR(3X) for more information.
135be completely displayed.
136See \fBcurs_pad\fR(3X) for more information.
120.PP
121In addition to drawing characters on the screen, video attributes and colors
122may be supported, causing the characters to show up in such modes as
123underlined, in reverse video, or in color on terminals that support such
137.PP
138In addition to drawing characters on the screen, video attributes and colors
139may be supported, causing the characters to show up in such modes as
140underlined, in reverse video, or in color on terminals that support such
124display enhancements. Line drawing characters may be specified to be output.
141display enhancements.
142Line drawing characters may be specified to be output.
125On input, \fBcurses\fR is also able to translate arrow and function keys that
143On input, \fBcurses\fR is also able to translate arrow and function keys that
126transmit escape sequences into single values. The video attributes, line
144transmit escape sequences into single values.
145The video attributes, line
127drawing characters, and input values use names, defined in \fB<curses.h>\fR,
128such as \fBA_REVERSE\fR, \fBACS_HLINE\fR, and \fBKEY_LEFT\fR.
129.PP
130If the environment variables \fBLINES\fR and \fBCOLUMNS\fR are set, or if the
131program is executing in a window environment, line and column information in
146drawing characters, and input values use names, defined in \fB<curses.h>\fR,
147such as \fBA_REVERSE\fR, \fBACS_HLINE\fR, and \fBKEY_LEFT\fR.
148.PP
149If the environment variables \fBLINES\fR and \fBCOLUMNS\fR are set, or if the
150program is executing in a window environment, line and column information in
132the environment will override information read by \fIterminfo\fR. This would
133effect a program running in an AT&T 630 layer, for example, where the size of a
151the environment will override information read by \fIterminfo\fR.
152This would affect a program running in an AT&T 630 layer,
153for example, where the size of a
134screen is changeable (see \fBENVIRONMENT\fR).
135.PP
136If the environment variable \fBTERMINFO\fR is defined, any program using
137\fBcurses\fR checks for a local terminal definition before checking in the
154screen is changeable (see \fBENVIRONMENT\fR).
155.PP
156If the environment variable \fBTERMINFO\fR is defined, any program using
157\fBcurses\fR checks for a local terminal definition before checking in the
138standard place. For example, if \fBTERM\fR is set to \fBatt4424\fR, then the
158standard place.
159For example, if \fBTERM\fR is set to \fBatt4424\fR, then the
139compiled terminal definition is found in
140.sp
141 \fB\*d/a/att4424\fR.
142.sp
143(The \fBa\fR is copied from the first letter of \fBatt4424\fR to avoid
144creation of huge directories.) However, if \fBTERMINFO\fR is set to
145\fB$HOME/myterms\fR, \fBcurses\fR first checks
146.sp
147 \fB$HOME/myterms/a/att4424\fR,
148.sp
149and if that fails, it then checks
150.sp
151 \fB\*d/a/att4424\fR.
152.sp
153This is useful for developing experimental definitions or when write
154permission in \fB\*d\fR is not available.
155.PP
156The integer variables \fBLINES\fR and \fBCOLS\fR are defined in
157\fB<curses.h>\fR and will be filled in by \fBinitscr\fR with the size of the
160compiled terminal definition is found in
161.sp
162 \fB\*d/a/att4424\fR.
163.sp
164(The \fBa\fR is copied from the first letter of \fBatt4424\fR to avoid
165creation of huge directories.) However, if \fBTERMINFO\fR is set to
166\fB$HOME/myterms\fR, \fBcurses\fR first checks
167.sp
168 \fB$HOME/myterms/a/att4424\fR,
169.sp
170and if that fails, it then checks
171.sp
172 \fB\*d/a/att4424\fR.
173.sp
174This is useful for developing experimental definitions or when write
175permission in \fB\*d\fR is not available.
176.PP
177The integer variables \fBLINES\fR and \fBCOLS\fR are defined in
178\fB<curses.h>\fR and will be filled in by \fBinitscr\fR with the size of the
158screen. The constants \fBTRUE\fR and \fBFALSE\fR have the values \fB1\fR and
179screen.
180The constants \fBTRUE\fR and \fBFALSE\fR have the values \fB1\fR and
159\fB0\fR, respectively.
160.PP
161The \fBcurses\fR routines also define the \fBWINDOW *\fR variable \fBcurscr\fR
162which is used for certain low-level operations like clearing and redrawing a
181\fB0\fR, respectively.
182.PP
183The \fBcurses\fR routines also define the \fBWINDOW *\fR variable \fBcurscr\fR
184which is used for certain low-level operations like clearing and redrawing a
163screen containing garbage. The \fBcurscr\fR can be used in only a few
164routines.
165.
185screen containing garbage.
186The \fBcurscr\fR can be used in only a few routines.
187.\"
166.SS Routine and Argument Names
188.SS Routine and Argument Names
167Many \fBcurses\fR routines have two or more versions. The routines prefixed
168with \fBw\fR require a window argument. The routines prefixed with \fBp\fR
169require a pad argument. Those without a prefix generally use \fBstdscr\fR.
189Many \fBcurses\fR routines have two or more versions.
190The routines prefixed with \fBw\fR require a window argument.
191The routines prefixed with \fBp\fR require a pad argument.
192Those without a prefix generally use \fBstdscr\fR.
170.PP
171The routines prefixed with \fBmv\fR require a \fIy\fR and \fIx\fR
193.PP
194The routines prefixed with \fBmv\fR require a \fIy\fR and \fIx\fR
172coordinate to move to before performing the appropriate action. The
173\fBmv\fR routines imply a call to \fBmove\fR before the call to the
174other routine. The coordinate \fIy\fR always refers to the row (of
175the window), and \fIx\fR always refers to the column. The upper
176left-hand corner is always (0,0), not (1,1).
195coordinate to move to before performing the appropriate action.
196The \fBmv\fR routines imply a call to \fBmove\fR before the call to the
197other routine.
198The coordinate \fIy\fR always refers to the row (of
199the window), and \fIx\fR always refers to the column.
200The upper left-hand corner is always (0,0), not (1,1).
177.PP
178The routines prefixed with \fBmvw\fR take both a window argument and
201.PP
202The routines prefixed with \fBmvw\fR take both a window argument and
179\fIx\fR and \fIy\fR coordinates. The window argument is always
180specified before the coordinates.
203\fIx\fR and \fIy\fR coordinates.
204The window argument is always specified before the coordinates.
181.PP
182In each case, \fIwin\fR is the window affected, and \fIpad\fR is the
183pad affected; \fIwin\fR and \fIpad\fR are always pointers to type
184\fBWINDOW\fR.
185.PP
186Option setting routines require a Boolean flag \fIbf\fR with the value
205.PP
206In each case, \fIwin\fR is the window affected, and \fIpad\fR is the
207pad affected; \fIwin\fR and \fIpad\fR are always pointers to type
208\fBWINDOW\fR.
209.PP
210Option setting routines require a Boolean flag \fIbf\fR with the value
187\fBTRUE\fR or \fBFALSE\fR; \fIbf\fR is always of type \fBbool\fR. The
188variables \fIch\fR and \fIattrs\fR below are always of type
189\fBchtype\fR. The types \fBWINDOW\fR, \fBSCREEN\fR, \fBbool\fR, and
190\fBchtype\fR are defined in \fB<curses.h>\fR. The type \fBTERMINAL\fR
191is defined in \fB<term.h>\fR. All other arguments are integers.
211\fBTRUE\fR or \fBFALSE\fR; \fIbf\fR is always of type \fBbool\fR.
212Most of the data types used in the library routines,
213such as \fBWINDOW\fR, \fBSCREEN\fR, \fBbool\fR, and \fBchtype\fR
214are defined in \fB<curses.h>\fR.
215Types used for the terminfo routines such as
216\fBTERMINAL\fR are defined in \fB<term.h>\fR.
217.PP
218This manual page describes functions which may appear in any configuration
219of the library.
220There are two common configurations of the library:
221.RS
222.TP 5
223ncurses
224the "normal" library, which handles 8-bit characters.
225The normal (8-bit) library stores characters combined with attributes
226in \fBchtype\fP data.
227.IP
228Attributes alone (no corresponding character) may be stored in \fBchtype\fP
229or the equivalent \fBattr_t\fP data.
230In either case, the data is stored in something like an integer.
231.IP
232Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBchtype\fP.
233.TP 5
234ncursesw
235the so-called "wide" library, which handles multibyte characters
236(See the section on \fBALTERNATE CONFIGURATIONS\fP).
237The "wide" library includes all of the calls from the "normal" library.
238It adds about one third more calls using data types which store
239multibyte characters:
240.RS
241.TP 5
242.B cchar_t
243corresponds to \fBchtype\fP.
244However it is a structure, because more data is stored than can fit into
245an integer.
246The characters are large enough to require a full integer value - and there
247may be more than one character per cell.
248The video attributes and color are stored in separate fields of the structure.
249.IP
250Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBcchar_t\fP.
251.TP 5
252.B wchar_t
253stores a "wide" character.
254Like \fBchtype\fP, this may be an integer.
255.TP 5
256.B wint_t
257stores a \fBwchar_t\fP or \fBWEOF\fP - not the same, though both may have
258the same size.
259.RE
260.IP
261The "wide" library provides new functions which are analogous to
262functions in the "normal" library.
263There is a naming convention which relates many of the normal/wide variants:
264a "_w" is inserted into the name.
265For example, \fBwaddch\fP becomes \fBwadd_wch\fP.
266.RE
267.PP
268.\"
192.SS Routine Name Index
193The following table lists each \fBcurses\fR routine and the name of
269.SS Routine Name Index
270The following table lists each \fBcurses\fR routine and the name of
194the manual page on which it is described. Routines flagged with `*'
271the manual page on which it is described.
272Routines flagged with `*'
195are ncurses-specific, not described by XPG4 or present in SVr4.
196.PP
197.TS
198center tab(/);
199l l
200l l .
201\fBcurses\fR Routine Name/Manual Page Name
202=

--- 67 unchanged lines hidden (view full) ---

270erase/\fBcurs_clear\fR(3X)
271erasechar/\fBcurs_termattrs\fR(3X)
272erasewchar/\fBcurs_termattrs\fR(3X)
273filter/\fBcurs_util\fR(3X)
274flash/\fBcurs_beep\fR(3X)
275flushinp/\fBcurs_util\fR(3X)
276get_wch/\fBcurs_get_wch\fR(3X)
277get_wstr/\fBcurs_get_wstr\fR(3X)
273are ncurses-specific, not described by XPG4 or present in SVr4.
274.PP
275.TS
276center tab(/);
277l l
278l l .
279\fBcurses\fR Routine Name/Manual Page Name
280=

--- 67 unchanged lines hidden (view full) ---

348erase/\fBcurs_clear\fR(3X)
349erasechar/\fBcurs_termattrs\fR(3X)
350erasewchar/\fBcurs_termattrs\fR(3X)
351filter/\fBcurs_util\fR(3X)
352flash/\fBcurs_beep\fR(3X)
353flushinp/\fBcurs_util\fR(3X)
354get_wch/\fBcurs_get_wch\fR(3X)
355get_wstr/\fBcurs_get_wstr\fR(3X)
356getattrs/\fBcurs_attr\fR(3X)
357getbegx/\fBcurs_legacy\fR(3X)*
358getbegy/\fBcurs_legacy\fR(3X)*
278getbegyx/\fBcurs_getyx\fR(3X)
279getbkgd/\fBcurs_bkgd\fR(3X)
280getbkgrnd/\fBcurs_bkgrnd\fR(3X)
281getcchar/\fBcurs_getcchar\fR(3X)
282getch/\fBcurs_getch\fR(3X)
359getbegyx/\fBcurs_getyx\fR(3X)
360getbkgd/\fBcurs_bkgd\fR(3X)
361getbkgrnd/\fBcurs_bkgrnd\fR(3X)
362getcchar/\fBcurs_getcchar\fR(3X)
363getch/\fBcurs_getch\fR(3X)
364getcurx/\fBcurs_legacy\fR(3X)*
365getcury/\fBcurs_legacy\fR(3X)*
366getmaxx/\fBcurs_legacy\fR(3X)*
367getmaxy/\fBcurs_legacy\fR(3X)*
283getmaxyx/\fBcurs_getyx\fR(3X)
284getmouse/\fBcurs_mouse\fR(3X)*
285getn_wstr/\fBcurs_get_wstr\fR(3X)
286getnstr/\fBcurs_getstr\fR(3X)
368getmaxyx/\fBcurs_getyx\fR(3X)
369getmouse/\fBcurs_mouse\fR(3X)*
370getn_wstr/\fBcurs_get_wstr\fR(3X)
371getnstr/\fBcurs_getstr\fR(3X)
372getparx/\fBcurs_legacy\fR(3X)*
373getpary/\fBcurs_legacy\fR(3X)*
287getparyx/\fBcurs_getyx\fR(3X)
288getstr/\fBcurs_getstr\fR(3X)
289getsyx/\fBcurs_kernel\fR(3X)
290getwin/\fBcurs_util\fR(3X)
291getyx/\fBcurs_getyx\fR(3X)
292halfdelay/\fBcurs_inopts\fR(3X)
293has_colors/\fBcurs_color\fR(3X)
294has_ic/\fBcurs_termattrs\fR(3X)

--- 21 unchanged lines hidden (view full) ---

316insch/\fBcurs_insch\fR(3X)
317insdelln/\fBcurs_deleteln\fR(3X)
318insertln/\fBcurs_deleteln\fR(3X)
319insnstr/\fBcurs_insstr\fR(3X)
320insstr/\fBcurs_insstr\fR(3X)
321instr/\fBcurs_instr\fR(3X)
322intrflush/\fBcurs_inopts\fR(3X)
323inwstr/\fBcurs_inwstr\fR(3X)
374getparyx/\fBcurs_getyx\fR(3X)
375getstr/\fBcurs_getstr\fR(3X)
376getsyx/\fBcurs_kernel\fR(3X)
377getwin/\fBcurs_util\fR(3X)
378getyx/\fBcurs_getyx\fR(3X)
379halfdelay/\fBcurs_inopts\fR(3X)
380has_colors/\fBcurs_color\fR(3X)
381has_ic/\fBcurs_termattrs\fR(3X)

--- 21 unchanged lines hidden (view full) ---

403insch/\fBcurs_insch\fR(3X)
404insdelln/\fBcurs_deleteln\fR(3X)
405insertln/\fBcurs_deleteln\fR(3X)
406insnstr/\fBcurs_insstr\fR(3X)
407insstr/\fBcurs_insstr\fR(3X)
408instr/\fBcurs_instr\fR(3X)
409intrflush/\fBcurs_inopts\fR(3X)
410inwstr/\fBcurs_inwstr\fR(3X)
411is_cleared/\fBcurs_opaque\fR(3X)*
412is_idcok/\fBcurs_opaque\fR(3X)*
413is_idlok/\fBcurs_opaque\fR(3X)*
414is_immedok/\fBcurs_opaque\fR(3X)*
415is_keypad/\fBcurs_opaque\fR(3X)*
416is_leaveok/\fBcurs_opaque\fR(3X)*
324is_linetouched/\fBcurs_touch\fR(3X)
417is_linetouched/\fBcurs_touch\fR(3X)
418is_nodelay/\fBcurs_opaque\fR(3X)*
419is_notimeout/\fBcurs_opaque\fR(3X)*
420is_scrollok/\fBcurs_opaque\fR(3X)*
421is_syncok/\fBcurs_opaque\fR(3X)*
422is_term_resized/\fBresizeterm\fR(3X)*
325is_wintouched/\fBcurs_touch\fR(3X)
326isendwin/\fBcurs_initscr\fR(3X)
327key_defined/\fBkey_defined\fR(3X)*
328key_name/\fBcurs_util\fR(3X)
329keybound/\fBkeybound\fR(3X)*
330keyname/\fBcurs_util\fR(3X)
331keyok/\fBkeyok\fR(3X)*
332keypad/\fBcurs_inopts\fR(3X)

--- 93 unchanged lines hidden (view full) ---

426napms/\fBcurs_kernel\fR(3X)
427newpad/\fBcurs_pad\fR(3X)
428newterm/\fBcurs_initscr\fR(3X)
429newwin/\fBcurs_window\fR(3X)
430nl/\fBcurs_outopts\fR(3X)
431nocbreak/\fBcurs_inopts\fR(3X)
432nodelay/\fBcurs_inopts\fR(3X)
433noecho/\fBcurs_inopts\fR(3X)
423is_wintouched/\fBcurs_touch\fR(3X)
424isendwin/\fBcurs_initscr\fR(3X)
425key_defined/\fBkey_defined\fR(3X)*
426key_name/\fBcurs_util\fR(3X)
427keybound/\fBkeybound\fR(3X)*
428keyname/\fBcurs_util\fR(3X)
429keyok/\fBkeyok\fR(3X)*
430keypad/\fBcurs_inopts\fR(3X)

--- 93 unchanged lines hidden (view full) ---

524napms/\fBcurs_kernel\fR(3X)
525newpad/\fBcurs_pad\fR(3X)
526newterm/\fBcurs_initscr\fR(3X)
527newwin/\fBcurs_window\fR(3X)
528nl/\fBcurs_outopts\fR(3X)
529nocbreak/\fBcurs_inopts\fR(3X)
530nodelay/\fBcurs_inopts\fR(3X)
531noecho/\fBcurs_inopts\fR(3X)
532nofilter/\fBcurs_util\fR(3X)*
434nonl/\fBcurs_outopts\fR(3X)
435noqiflush/\fBcurs_inopts\fR(3X)
436noraw/\fBcurs_inopts\fR(3X)
437notimeout/\fBcurs_inopts\fR(3X)
438overlay/\fBcurs_overlay\fR(3X)
439overwrite/\fBcurs_overlay\fR(3X)
440pair_content/\fBcurs_color\fR(3X)
441pechochar/\fBcurs_pad\fR(3X)

--- 72 unchanged lines hidden (view full) ---

514unctrl/\fBcurs_util\fR(3X)
515unget_wch/\fBcurs_get_wch\fR(3X)
516ungetch/\fBcurs_getch\fR(3X)
517ungetmouse/\fBcurs_mouse\fR(3X)*
518untouchwin/\fBcurs_touch\fR(3X)
519use_default_colors/\fBdefault_colors\fR(3X)*
520use_env/\fBcurs_util\fR(3X)
521use_extended_names/\fBcurs_extend\fR(3X)*
533nonl/\fBcurs_outopts\fR(3X)
534noqiflush/\fBcurs_inopts\fR(3X)
535noraw/\fBcurs_inopts\fR(3X)
536notimeout/\fBcurs_inopts\fR(3X)
537overlay/\fBcurs_overlay\fR(3X)
538overwrite/\fBcurs_overlay\fR(3X)
539pair_content/\fBcurs_color\fR(3X)
540pechochar/\fBcurs_pad\fR(3X)

--- 72 unchanged lines hidden (view full) ---

613unctrl/\fBcurs_util\fR(3X)
614unget_wch/\fBcurs_get_wch\fR(3X)
615ungetch/\fBcurs_getch\fR(3X)
616ungetmouse/\fBcurs_mouse\fR(3X)*
617untouchwin/\fBcurs_touch\fR(3X)
618use_default_colors/\fBdefault_colors\fR(3X)*
619use_env/\fBcurs_util\fR(3X)
620use_extended_names/\fBcurs_extend\fR(3X)*
621use_legacy_coding/\fBlegacy_coding\fR(3X)*
522vid_attr/\fBcurs_terminfo\fR(3X)
523vid_puts/\fBcurs_terminfo\fR(3X)
524vidattr/\fBcurs_terminfo\fR(3X)
525vidputs/\fBcurs_terminfo\fR(3X)
526vline/\fBcurs_border\fR(3X)
527vline_set/\fBcurs_border_set\fR(3X)
528vw_printw/\fBcurs_printw\fR(3X)
529vw_scanw/\fBcurs_scanw\fR(3X)

--- 82 unchanged lines hidden (view full) ---

612wvline_set/\fBcurs_border_set\fR(3X)
613.TE
614.SH RETURN VALUE
615Routines that return an integer return \fBERR\fR upon failure and an
616integer value other than \fBERR\fR upon successful completion, unless
617otherwise noted in the routine descriptions.
618.PP
619All macros return the value of the \fBw\fR version, except \fBsetscrreg\fR,
622vid_attr/\fBcurs_terminfo\fR(3X)
623vid_puts/\fBcurs_terminfo\fR(3X)
624vidattr/\fBcurs_terminfo\fR(3X)
625vidputs/\fBcurs_terminfo\fR(3X)
626vline/\fBcurs_border\fR(3X)
627vline_set/\fBcurs_border_set\fR(3X)
628vw_printw/\fBcurs_printw\fR(3X)
629vw_scanw/\fBcurs_scanw\fR(3X)

--- 82 unchanged lines hidden (view full) ---

712wvline_set/\fBcurs_border_set\fR(3X)
713.TE
714.SH RETURN VALUE
715Routines that return an integer return \fBERR\fR upon failure and an
716integer value other than \fBERR\fR upon successful completion, unless
717otherwise noted in the routine descriptions.
718.PP
719All macros return the value of the \fBw\fR version, except \fBsetscrreg\fR,
620\fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and \fBgetmaxyx\fR. The return
621values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and
720\fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and \fBgetmaxyx\fR.
721The return values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and
622\fBgetmaxyx\fR are undefined (i.e., these should not be used as the
623right-hand side of assignment statements).
624.PP
625Routines that return pointers return \fBNULL\fR on error.
626.SH ENVIRONMENT
627The following environment symbols are useful for customizing the
722\fBgetmaxyx\fR are undefined (i.e., these should not be used as the
723right-hand side of assignment statements).
724.PP
725Routines that return pointers return \fBNULL\fR on error.
726.SH ENVIRONMENT
727The following environment symbols are useful for customizing the
628runtime behavior of the \fBncurses\fR library. The most important
629ones have been already discussed in detail.
728runtime behavior of the \fBncurses\fR library.
729The most important ones have been already discussed in detail.
630.TP 5
631BAUDRATE
632The debugging library checks this environment symbol when the application
633has redirected output to a file.
634The symbol's numeric value is used for the baudrate.
635If no value is found, \fBncurses\fR uses 9600.
636This allows testers to construct repeatable test-cases
637that take into account costs that depend on baudrate.

--- 79 unchanged lines hidden (view full) ---

717.sp
718This symbol lets you customize the mouse.
719The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321.
720If it is not specified, \fBncurses\fR uses 132.
721.TP 5
722NCURSES_ASSUMED_COLORS
723Override the compiled-in assumption that the
724terminal's default colors are white-on-black
730.TP 5
731BAUDRATE
732The debugging library checks this environment symbol when the application
733has redirected output to a file.
734The symbol's numeric value is used for the baudrate.
735If no value is found, \fBncurses\fR uses 9600.
736This allows testers to construct repeatable test-cases
737that take into account costs that depend on baudrate.

--- 79 unchanged lines hidden (view full) ---

817.sp
818This symbol lets you customize the mouse.
819The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321.
820If it is not specified, \fBncurses\fR uses 132.
821.TP 5
822NCURSES_ASSUMED_COLORS
823Override the compiled-in assumption that the
824terminal's default colors are white-on-black
725(see \fBassume_default_colors\fR(3X)).
825(see \fBdefault_colors\fR(3X)).
726You may set the foreground and background color values with this environment
727variable by proving a 2-element list: foreground,background.
728For example, to tell ncurses to not assume anything
729about the colors, set this to "-1,-1".
730To make it green-on-black, set it to "2,0".
731Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed.
732.TP 5
733NCURSES_NO_HARD_TABS
734\fBNcurses\fP may use tabs as part of the cursor movement optimization.
735In some cases,
736your terminal driver may not handle these properly.
737Set this environment variable to disable the feature.
738You can also adjust your \fBstty\fP settings to avoid the problem.
739.TP 5
740NCURSES_NO_MAGIC_COOKIES
741Some terminals use a magic-cookie feature which requires special handling
826You may set the foreground and background color values with this environment
827variable by proving a 2-element list: foreground,background.
828For example, to tell ncurses to not assume anything
829about the colors, set this to "-1,-1".
830To make it green-on-black, set it to "2,0".
831Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed.
832.TP 5
833NCURSES_NO_HARD_TABS
834\fBNcurses\fP may use tabs as part of the cursor movement optimization.
835In some cases,
836your terminal driver may not handle these properly.
837Set this environment variable to disable the feature.
838You can also adjust your \fBstty\fP settings to avoid the problem.
839.TP 5
840NCURSES_NO_MAGIC_COOKIES
841Some terminals use a magic-cookie feature which requires special handling
742to make highlighting and other video attributes display properly.
842to make highlighting and other video attributes display properly.
743You can suppress the highlighting entirely for these terminals by
744setting this environment variable.
745.TP 5
746NCURSES_NO_PADDING
747Most of the terminal descriptions in the terminfo database are written
748for real "hardware" terminals.
749Many people use terminal emulators
750which run in a windowing environment and use curses-based applications.

--- 5 unchanged lines hidden (view full) ---

756Unless a hardware terminal is interfaced into a terminal concentrator
757(which does flow control),
758it (or your application) must manage dataflow, preventing overruns.
759The cheapest solution (no hardware cost)
760is for your program to do this by pausing after
761operations that the terminal does slowly, such as clearing the display.
762.IP
763As a result, many terminal descriptions (including the vt100)
843You can suppress the highlighting entirely for these terminals by
844setting this environment variable.
845.TP 5
846NCURSES_NO_PADDING
847Most of the terminal descriptions in the terminfo database are written
848for real "hardware" terminals.
849Many people use terminal emulators
850which run in a windowing environment and use curses-based applications.

--- 5 unchanged lines hidden (view full) ---

856Unless a hardware terminal is interfaced into a terminal concentrator
857(which does flow control),
858it (or your application) must manage dataflow, preventing overruns.
859The cheapest solution (no hardware cost)
860is for your program to do this by pausing after
861operations that the terminal does slowly, such as clearing the display.
862.IP
863As a result, many terminal descriptions (including the vt100)
764have delay times embedded. You may wish to use these descriptions,
864have delay times embedded.
865You may wish to use these descriptions,
765but not want to pay the performance penalty.
766.IP
767Set the NCURSES_NO_PADDING symbol to disable all but mandatory
866but not want to pay the performance penalty.
867.IP
868Set the NCURSES_NO_PADDING symbol to disable all but mandatory
768padding. Mandatory padding is used as a part of special control
869padding.
870Mandatory padding is used as a part of special control
769sequences such as \fIflash\fR.
770.TP 5
771NCURSES_NO_SETBUF
772Normally \fBncurses\fR enables buffered output during terminal initialization.
773This is done (as in SVr4 curses) for performance reasons.
774For testing purposes, both of \fBncurses\fR and certain applications,
871sequences such as \fIflash\fR.
872.TP 5
873NCURSES_NO_SETBUF
874Normally \fBncurses\fR enables buffered output during terminal initialization.
875This is done (as in SVr4 curses) for performance reasons.
876For testing purposes, both of \fBncurses\fR and certain applications,
775this feature is made optional. Setting the NCURSES_NO_SETBUF variable
877this feature is made optional.
878Setting the NCURSES_NO_SETBUF variable
776disables output buffering, leaving the output in the original (usually
777line buffered) mode.
778.TP 5
779NCURSES_NO_UTF8_ACS
780During initialization, the \fBncurses\fR library
781checks for special cases where VT100 line-drawing (and the corresponding
782alternate character set capabilities) described in the terminfo are known
783to be missing.

--- 155 unchanged lines hidden (view full) ---

939@TERMINFO@
940terminal capability database
941.SH SEE ALSO
942\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine
943descriptions.
944.SH EXTENSIONS
945The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR)
946that falls back to the old-style /etc/termcap file if the terminal setup code
879disables output buffering, leaving the output in the original (usually
880line buffered) mode.
881.TP 5
882NCURSES_NO_UTF8_ACS
883During initialization, the \fBncurses\fR library
884checks for special cases where VT100 line-drawing (and the corresponding
885alternate character set capabilities) described in the terminfo are known
886to be missing.

--- 155 unchanged lines hidden (view full) ---

1042@TERMINFO@
1043terminal capability database
1044.SH SEE ALSO
1045\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine
1046descriptions.
1047.SH EXTENSIONS
1048The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR)
1049that falls back to the old-style /etc/termcap file if the terminal setup code
947cannot find a terminfo entry corresponding to \fBTERM\fR. Use of this feature
1050cannot find a terminfo entry corresponding to \fBTERM\fR.
1051Use of this feature
948is not recommended, as it essentially includes an entire termcap compiler in
949the \fBncurses\fR startup code, at significant cost in core and startup cycles.
950.PP
951The \fBncurses\fR library includes facilities for capturing mouse events on
1052is not recommended, as it essentially includes an entire termcap compiler in
1053the \fBncurses\fR startup code, at significant cost in core and startup cycles.
1054.PP
1055The \fBncurses\fR library includes facilities for capturing mouse events on
952certain terminals (including xterm). See the \fBcurs_mouse\fR(3X)
1056certain terminals (including xterm).
1057See the \fBcurs_mouse\fR(3X)
953manual page for details.
954.PP
955The \fBncurses\fR library includes facilities for responding to window
956resizing events, e.g., when running in an xterm.
957See the \fBresizeterm\fR(3X)
958and \fBwresize\fR(3X) manual pages for details.
959In addition, the library may be configured with a SIGWINCH handler.
960.PP

--- 8 unchanged lines hidden (view full) ---

969implement the ISO-6429 SGR 39 and SGR 49 controls, which allow an application
970to reset the terminal to its original foreground and background colors.
971From the users' perspective, the application is able to draw colored
972text on a background whose color is set independently, providing better
973control over color contrasts.
974See the \fBdefault_colors\fR(3X) manual page for details.
975.PP
976The \fBncurses\fR library includes a function for directing application output
1058manual page for details.
1059.PP
1060The \fBncurses\fR library includes facilities for responding to window
1061resizing events, e.g., when running in an xterm.
1062See the \fBresizeterm\fR(3X)
1063and \fBwresize\fR(3X) manual pages for details.
1064In addition, the library may be configured with a SIGWINCH handler.
1065.PP

--- 8 unchanged lines hidden (view full) ---

1074implement the ISO-6429 SGR 39 and SGR 49 controls, which allow an application
1075to reset the terminal to its original foreground and background colors.
1076From the users' perspective, the application is able to draw colored
1077text on a background whose color is set independently, providing better
1078control over color contrasts.
1079See the \fBdefault_colors\fR(3X) manual page for details.
1080.PP
1081The \fBncurses\fR library includes a function for directing application output
977to a printer attached to the terminal device. See the \fBcurs_print\fR(3X)
978manual page for details.
1082to a printer attached to the terminal device.
1083See the \fBcurs_print\fR(3X) manual page for details.
979.SH PORTABILITY
1084.SH PORTABILITY
980The \fBncurses\fR library is intended to be BASE-level conformant with the XSI
981Curses standard. The EXTENDED XSI Curses functionality
1085The \fBncurses\fR library is intended to be BASE-level conformant with XSI
1086Curses.
1087The EXTENDED XSI Curses functionality
982(including color support) is supported.
983.PP
984A small number of local differences (that is, individual differences between
985the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR
986sections of the library man pages.
987.PP
1088(including color support) is supported.
1089.PP
1090A small number of local differences (that is, individual differences between
1091the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR
1092sections of the library man pages.
1093.PP
988The routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4. See
989the \fBcurs_getch\fR(3X) manual page for details.
1094This implementation also contains several extensions:
1095.RS 5
990.PP
1096.PP
991The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4. See
992the \fBcurs_slk\fR(3X) manual page for details.
1097The routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4.
1098See the \fBcurs_getch\fR(3X) manual page for details.
993.PP
1099.PP
1100The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4.
1101See the \fBcurs_slk\fR(3X) manual page for details.
1102.PP
994The routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,
995\fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are not
1103The routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,
1104\fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are not
996part of XPG4, nor are they present in SVr4. See the \fBcurs_mouse\fR(3X)
997manual page for details.
1105part of XPG4, nor are they present in SVr4.
1106See the \fBcurs_mouse\fR(3X) manual page for details.
998.PP
1107.PP
999The routine \fBmcprint\fR was not present in any previous curses
1000implementation. See the \fBcurs_print\fR(3X) manual page for details.
1108The routine \fBmcprint\fR was not present in any previous curses implementation.
1109See the \fBcurs_print\fR(3X) manual page for details.
1001.PP
1110.PP
1002The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4. See
1003the \fBwresize\fR(3X) manual page for details.
1111The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4.
1112See the \fBwresize\fR(3X) manual page for details.
1004.PP
1113.PP
1114The WINDOW structure's internal details can be hidden from application
1115programs.
1116See \fBcurs_opaque\fR(3X) for the discussion of \fBis_scrollok\fR, etc.
1117.RE
1118.PP
1005In historic curses versions, delays embedded in the capabilities \fBcr\fR,
1006\fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delay
1119In historic curses versions, delays embedded in the capabilities \fBcr\fR,
1120\fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delay
1007bits in the UNIX tty driver. In this implementation, all padding is done by
1008NUL sends. This method is slightly more expensive, but narrows the interface
1121bits in the UNIX tty driver.
1122In this implementation, all padding is done by sending NUL bytes.
1123This method is slightly more expensive, but narrows the interface
1009to the UNIX kernel significantly and increases the package's portability
1010correspondingly.
1011.SH NOTES
1012The header file \fB<curses.h>\fR automatically includes the header files
1013\fB<stdio.h>\fR and \fB<unctrl.h>\fR.
1014.PP
1015If standard output from a \fBncurses\fR program is re-directed to something
1124to the UNIX kernel significantly and increases the package's portability
1125correspondingly.
1126.SH NOTES
1127The header file \fB<curses.h>\fR automatically includes the header files
1128\fB<stdio.h>\fR and \fB<unctrl.h>\fR.
1129.PP
1130If standard output from a \fBncurses\fR program is re-directed to something
1016which is not a tty, screen updates will be directed to standard error. This
1017was an undocumented feature of AT&T System V Release 3 curses.
1131which is not a tty, screen updates will be directed to standard error.
1132This was an undocumented feature of AT&T System V Release 3 curses.
1018.SH AUTHORS
1019Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1020Based on pcurses by Pavel Curtis.
1021.\"#
1022.\"# The following sets edit modes for GNU EMACS
1023.\"# Local Variables:
1024.\"# mode:nroff
1025.\"# fill-column:79
1026.\"# End:
1133.SH AUTHORS
1134Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1135Based on pcurses by Pavel Curtis.
1136.\"#
1137.\"# The following sets edit modes for GNU EMACS
1138.\"# Local Variables:
1139.\"# mode:nroff
1140.\"# fill-column:79
1141.\"# End: