source: trunk/ncurses/man/ncurses.3x@ 2787

Last change on this file since 2787 was 2621, checked in by bird, 19 years ago

GNU ncurses 5.5

File size: 36.3 KB
Line 
1'\" t
2.\"***************************************************************************
3.\" Copyright (c) 1998-2004,2005 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: *
12.\" *
13.\" The above copyright notice and this permission notice shall be included *
14.\" in all copies or substantial portions of the Software. *
15.\" *
16.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
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.76 2005/09/03 17:42: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
42of updating character screens with reasonable optimization. This
43implementation is ``new curses'' (ncurses) and is the approved replacement for
444.4BSD classic curses, which has been discontinued.
45.PP
46The \fBncurses\fR routines emulate the \fBcurses\fR(3X) library of System V
47Release 4 UNIX, and the XPG4 curses standard (XSI curses) but the \fBncurses\fR
48library is freely redistributable in source form. Differences from the SVr4
49curses are summarized under the EXTENSIONS and PORTABILITY sections below and
50described in detail in the respective EXTENSIONS, PORTABILITY and BUGS sections
51of individual man pages.
52.PP
53A program using these routines must be linked with the \fB-lncurses\fR option,
54or (if it has been generated) with the debugging library \fB-lncurses_g\fR.
55(Your system integrator may also have installed these libraries under
56the names \fB-lcurses\fR and \fB-lcurses_g\fR.)
57The ncurses_g library generates trace logs (in a file called 'trace' in the
58current directory) that describe curses actions.
59.PP
60The \fBncurses\fR package supports: overall screen, window and pad
61manipulation; output to windows and pads; reading terminal input; control over
62terminal and \fBcurses\fR input and output options; environment query
63routines; color manipulation; use of soft label keys; terminfo capabilities;
64and access to low-level terminal-manipulation routines.
65.PP
66To initialize the routines, the routine \fBinitscr\fR or \fBnewterm\fR
67must be called before any of the other routines that deal with windows
68and screens are used. The routine \fBendwin\fR must be called before
69exiting. To get character-at-a-time input without echoing (most
70interactive, screen oriented programs want this), the following
71sequence should be used:
72.sp
73 \fBinitscr(); cbreak(); noecho();\fR
74.sp
75Most programs would additionally use the sequence:
76.sp
77 \fBnonl();\fR
78 \fBintrflush(stdscr, FALSE);\fR
79 \fBkeypad(stdscr, TRUE);\fR
80.sp
81Before a \fBcurses\fR program is run, the tab stops of the terminal
82should be set and its initialization strings, if defined, must be
83output. This can be done by executing the \fBtput init\fR command
84after the shell environment variable \fBTERM\fR has been exported.
85\fBtset(1)\fR is usually responsible for doing this.
86[See \fBterminfo\fR(\*n) for further details.]
87.PP
88The \fBncurses\fR library permits manipulation of data structures,
89called \fIwindows\fR, which can be thought of as two-dimensional
90arrays of characters representing all or part of a CRT screen. A
91default window called \fBstdscr\fR, which is the size of the terminal
92screen, is supplied. Others may be created with \fBnewwin\fR.
93.PP
94Note that \fBcurses\fR does not handle overlapping windows, that's done by
95the \fBpanel\fR(3X) library. This means that you can either use
96\fBstdscr\fR or divide the screen into tiled windows and not using
97\fBstdscr\fR at all. Mixing the two will result in unpredictable, and
98undesired, effects.
99.PP
100Windows are referred to by variables declared as \fBWINDOW *\fR.
101These data structures are manipulated with routines described here and
102elsewhere in the \fBncurses\fR manual pages. Among which the most basic
103routines are \fBmove\fR and \fBaddch\fR. More general versions of
104these routines are included with names beginning with \fBw\fR,
105allowing the user to specify a window. The routines not beginning
106with \fBw\fR affect \fBstdscr\fR.)
107.PP
108After using routines to manipulate a window, \fBrefresh\fR is called,
109telling \fBcurses\fR to make the user's CRT screen look like
110\fBstdscr\fR. The characters in a window are actually of type
111\fBchtype\fR, (character and attribute data) so that other information
112about the character may also be stored with each character.
113.PP
114Special windows called \fIpads\fR may also be manipulated. These are windows
115which are not constrained to the size of the screen and whose contents need not
116be completely displayed. See \fBcurs_pad\fR(3X) for more information.
117.PP
118In addition to drawing characters on the screen, video attributes and colors
119may be supported, causing the characters to show up in such modes as
120underlined, in reverse video, or in color on terminals that support such
121display enhancements. Line drawing characters may be specified to be output.
122On input, \fBcurses\fR is also able to translate arrow and function keys that
123transmit escape sequences into single values. The video attributes, line
124drawing characters, and input values use names, defined in \fB<curses.h>\fR,
125such as \fBA_REVERSE\fR, \fBACS_HLINE\fR, and \fBKEY_LEFT\fR.
126.PP
127If the environment variables \fBLINES\fR and \fBCOLUMNS\fR are set, or if the
128program is executing in a window environment, line and column information in
129the environment will override information read by \fIterminfo\fR. This would
130effect a program running in an AT&T 630 layer, for example, where the size of a
131screen is changeable (see \fBENVIRONMENT\fR).
132.PP
133If the environment variable \fBTERMINFO\fR is defined, any program using
134\fBcurses\fR checks for a local terminal definition before checking in the
135standard place. For example, if \fBTERM\fR is set to \fBatt4424\fR, then the
136compiled terminal definition is found in
137.sp
138 \fB\*d/a/att4424\fR.
139.sp
140(The \fBa\fR is copied from the first letter of \fBatt4424\fR to avoid
141creation of huge directories.) However, if \fBTERMINFO\fR is set to
142\fB$HOME/myterms\fR, \fBcurses\fR first checks
143.sp
144 \fB$HOME/myterms/a/att4424\fR,
145.sp
146and if that fails, it then checks
147.sp
148 \fB\*d/a/att4424\fR.
149.sp
150This is useful for developing experimental definitions or when write
151permission in \fB\*d\fR is not available.
152.PP
153The integer variables \fBLINES\fR and \fBCOLS\fR are defined in
154\fB<curses.h>\fR and will be filled in by \fBinitscr\fR with the size of the
155screen. The constants \fBTRUE\fR and \fBFALSE\fR have the values \fB1\fR and
156\fB0\fR, respectively.
157.PP
158The \fBcurses\fR routines also define the \fBWINDOW *\fR variable \fBcurscr\fR
159which is used for certain low-level operations like clearing and redrawing a
160screen containing garbage. The \fBcurscr\fR can be used in only a few
161routines.
162.
163.SS Routine and Argument Names
164Many \fBcurses\fR routines have two or more versions. The routines prefixed
165with \fBw\fR require a window argument. The routines prefixed with \fBp\fR
166require a pad argument. Those without a prefix generally use \fBstdscr\fR.
167.PP
168The routines prefixed with \fBmv\fR require a \fIy\fR and \fIx\fR
169coordinate to move to before performing the appropriate action. The
170\fBmv\fR routines imply a call to \fBmove\fR before the call to the
171other routine. The coordinate \fIy\fR always refers to the row (of
172the window), and \fIx\fR always refers to the column. The upper
173left-hand corner is always (0,0), not (1,1).
174.PP
175The routines prefixed with \fBmvw\fR take both a window argument and
176\fIx\fR and \fIy\fR coordinates. The window argument is always
177specified before the coordinates.
178.PP
179In each case, \fIwin\fR is the window affected, and \fIpad\fR is the
180pad affected; \fIwin\fR and \fIpad\fR are always pointers to type
181\fBWINDOW\fR.
182.PP
183Option setting routines require a Boolean flag \fIbf\fR with the value
184\fBTRUE\fR or \fBFALSE\fR; \fIbf\fR is always of type \fBbool\fR. The
185variables \fIch\fR and \fIattrs\fR below are always of type
186\fBchtype\fR. The types \fBWINDOW\fR, \fBSCREEN\fR, \fBbool\fR, and
187\fBchtype\fR are defined in \fB<curses.h>\fR. The type \fBTERMINAL\fR
188is defined in \fB<term.h>\fR. All other arguments are integers.
189.SS Routine Name Index
190The following table lists each \fBcurses\fR routine and the name of
191the manual page on which it is described. Routines flagged with `*'
192are ncurses-specific, not described by XPG4 or present in SVr4.
193.PP
194.TS
195center tab(/);
196l l
197l l .
198\fBcurses\fR Routine Name/Manual Page Name
199=
200COLOR_PAIR/\fBcurs_color\fR(3X)
201PAIR_NUMBER/\fBcurs_attr\fR(3X)
202_nc_tracebits/\fBcurs_trace\fR(3X)*
203_traceattr/\fBcurs_trace\fR(3X)*
204_traceattr2/\fBcurs_trace\fR(3X)*
205_tracechar/\fBcurs_trace\fR(3X)*
206_tracechtype/\fBcurs_trace\fR(3X)*
207_tracechtype2/\fBcurs_trace\fR(3X)*
208_tracedump/\fBcurs_trace\fR(3X)*
209_tracef/\fBcurs_trace\fR(3X)*
210_tracemouse/\fBcurs_trace\fR(3X)*
211add_wch/\fBcurs_add_wch\fR(3X)
212add_wchnstr/\fBcurs_add_wchstr\fR(3X)
213add_wchstr/\fBcurs_add_wchstr\fR(3X)
214addch/\fBcurs_addch\fR(3X)
215addchnstr/\fBcurs_addchstr\fR(3X)
216addchstr/\fBcurs_addchstr\fR(3X)
217addnstr/\fBcurs_addstr\fR(3X)
218addnwstr/\fBcurs_addwstr\fR(3X)
219addstr/\fBcurs_addstr\fR(3X)
220addwstr/\fBcurs_addwstr\fR(3X)
221assume_default_colors/\fBdefault_colors\fR(3X)*
222attr_get/\fBcurs_attr\fR(3X)
223attr_off/\fBcurs_attr\fR(3X)
224attr_on/\fBcurs_attr\fR(3X)
225attr_set/\fBcurs_attr\fR(3X)
226attroff/\fBcurs_attr\fR(3X)
227attron/\fBcurs_attr\fR(3X)
228attrset/\fBcurs_attr\fR(3X)
229baudrate/\fBcurs_termattrs\fR(3X)
230beep/\fBcurs_beep\fR(3X)
231bkgd/\fBcurs_bkgd\fR(3X)
232bkgdset/\fBcurs_bkgd\fR(3X)
233bkgrnd/\fBcurs_bkgrnd\fR(3X)
234bkgrndset/\fBcurs_bkgrnd\fR(3X)
235border/\fBcurs_border\fR(3X)
236border_set/\fBcurs_border_set\fR(3X)
237box/\fBcurs_border\fR(3X)
238box_set/\fBcurs_border_set\fR(3X)
239can_change_color/\fBcurs_color\fR(3X)
240cbreak/\fBcurs_inopts\fR(3X)
241chgat/\fBcurs_attr\fR(3X)
242clear/\fBcurs_clear\fR(3X)
243clearok/\fBcurs_outopts\fR(3X)
244clrtobot/\fBcurs_clear\fR(3X)
245clrtoeol/\fBcurs_clear\fR(3X)
246color_content/\fBcurs_color\fR(3X)
247color_set/\fBcurs_attr\fR(3X)
248copywin/\fBcurs_overlay\fR(3X)
249curs_set/\fBcurs_kernel\fR(3X)
250curses_version/\fBcurs_extend\fR(3X)*
251def_prog_mode/\fBcurs_kernel\fR(3X)
252def_shell_mode/\fBcurs_kernel\fR(3X)
253define_key/\fBdefine_key\fR(3X)*
254del_curterm/\fBcurs_terminfo\fR(3X)
255delay_output/\fBcurs_util\fR(3X)
256delch/\fBcurs_delch\fR(3X)
257deleteln/\fBcurs_deleteln\fR(3X)
258delscreen/\fBcurs_initscr\fR(3X)
259delwin/\fBcurs_window\fR(3X)
260derwin/\fBcurs_window\fR(3X)
261doupdate/\fBcurs_refresh\fR(3X)
262dupwin/\fBcurs_window\fR(3X)
263echo/\fBcurs_inopts\fR(3X)
264echo_wchar/\fBcurs_add_wch\fR(3X)
265echochar/\fBcurs_addch\fR(3X)
266endwin/\fBcurs_initscr\fR(3X)
267erase/\fBcurs_clear\fR(3X)
268erasechar/\fBcurs_termattrs\fR(3X)
269erasewchar/\fBcurs_termattrs\fR(3X)
270filter/\fBcurs_util\fR(3X)
271flash/\fBcurs_beep\fR(3X)
272flushinp/\fBcurs_util\fR(3X)
273get_wch/\fBcurs_get_wch\fR(3X)
274get_wstr/\fBcurs_get_wstr\fR(3X)
275getbegyx/\fBcurs_getyx\fR(3X)
276getbkgd/\fBcurs_bkgd\fR(3X)
277getbkgrnd/\fBcurs_bkgrnd\fR(3X)
278getcchar/\fBcurs_getcchar\fR(3X)
279getch/\fBcurs_getch\fR(3X)
280getmaxyx/\fBcurs_getyx\fR(3X)
281getmouse/\fBcurs_mouse\fR(3X)*
282getn_wstr/\fBcurs_get_wstr\fR(3X)
283getnstr/\fBcurs_getstr\fR(3X)
284getparyx/\fBcurs_getyx\fR(3X)
285getstr/\fBcurs_getstr\fR(3X)
286getsyx/\fBcurs_kernel\fR(3X)
287getwin/\fBcurs_util\fR(3X)
288getyx/\fBcurs_getyx\fR(3X)
289halfdelay/\fBcurs_inopts\fR(3X)
290has_colors/\fBcurs_color\fR(3X)
291has_ic/\fBcurs_termattrs\fR(3X)
292has_il/\fBcurs_termattrs\fR(3X)
293has_key/\fBcurs_getch\fR(3X)*
294hline/\fBcurs_border\fR(3X)
295hline_set/\fBcurs_border_set\fR(3X)
296idcok/\fBcurs_outopts\fR(3X)
297idlok/\fBcurs_outopts\fR(3X)
298immedok/\fBcurs_outopts\fR(3X)
299in_wch/\fBcurs_in_wch\fR(3X)
300in_wchnstr/\fBcurs_in_wchstr\fR(3X)
301in_wchstr/\fBcurs_in_wchstr\fR(3X)
302inch/\fBcurs_inch\fR(3X)
303inchnstr/\fBcurs_inchstr\fR(3X)
304inchstr/\fBcurs_inchstr\fR(3X)
305init_color/\fBcurs_color\fR(3X)
306init_pair/\fBcurs_color\fR(3X)
307initscr/\fBcurs_initscr\fR(3X)
308innstr/\fBcurs_instr\fR(3X)
309innwstr/\fBcurs_inwstr\fR(3X)
310ins_nwstr/\fBcurs_ins_wstr\fR(3X)
311ins_wch/\fBcurs_ins_wch\fR(3X)
312ins_wstr/\fBcurs_ins_wstr\fR(3X)
313insch/\fBcurs_insch\fR(3X)
314insdelln/\fBcurs_deleteln\fR(3X)
315insertln/\fBcurs_deleteln\fR(3X)
316insnstr/\fBcurs_insstr\fR(3X)
317insstr/\fBcurs_insstr\fR(3X)
318instr/\fBcurs_instr\fR(3X)
319intrflush/\fBcurs_inopts\fR(3X)
320inwstr/\fBcurs_inwstr\fR(3X)
321is_linetouched/\fBcurs_touch\fR(3X)
322is_wintouched/\fBcurs_touch\fR(3X)
323isendwin/\fBcurs_initscr\fR(3X)
324key_defined/\fBkey_defined\fR(3X)*
325key_name/\fBcurs_util\fR(3X)
326keybound/\fBkeybound\fR(3X)*
327keyname/\fBcurs_util\fR(3X)
328keyok/\fBkeyok\fR(3X)*
329keypad/\fBcurs_inopts\fR(3X)
330killchar/\fBcurs_termattrs\fR(3X)
331killwchar/\fBcurs_termattrs\fR(3X)
332leaveok/\fBcurs_outopts\fR(3X)
333longname/\fBcurs_termattrs\fR(3X)
334mcprint/\fBcurs_print\fR(3X)*
335meta/\fBcurs_inopts\fR(3X)
336mouse_trafo/\fBcurs_mouse\fR(3X)*
337mouseinterval/\fBcurs_mouse\fR(3X)*
338mousemask/\fBcurs_mouse\fR(3X)*
339move/\fBcurs_move\fR(3X)
340mvadd_wch/\fBcurs_add_wch\fR(3X)
341mvadd_wchnstr/\fBcurs_add_wchstr\fR(3X)
342mvadd_wchstr/\fBcurs_add_wchstr\fR(3X)
343mvaddch/\fBcurs_addch\fR(3X)
344mvaddchnstr/\fBcurs_addchstr\fR(3X)
345mvaddchstr/\fBcurs_addchstr\fR(3X)
346mvaddnstr/\fBcurs_addstr\fR(3X)
347mvaddnwstr/\fBcurs_addwstr\fR(3X)
348mvaddstr/\fBcurs_addstr\fR(3X)
349mvaddwstr/\fBcurs_addwstr\fR(3X)
350mvchgat/\fBcurs_attr\fR(3X)
351mvcur/\fBcurs_terminfo\fR(3X)
352mvdelch/\fBcurs_delch\fR(3X)
353mvderwin/\fBcurs_window\fR(3X)
354mvget_wch/\fBcurs_get_wch\fR(3X)
355mvget_wstr/\fBcurs_get_wstr\fR(3X)
356mvgetch/\fBcurs_getch\fR(3X)
357mvgetn_wstr/\fBcurs_get_wstr\fR(3X)
358mvgetnstr/\fBcurs_getstr\fR(3X)
359mvgetstr/\fBcurs_getstr\fR(3X)
360mvhline/\fBcurs_border\fR(3X)
361mvhline_set/\fBcurs_border_set\fR(3X)
362mvin_wch/\fBcurs_in_wch\fR(3X)
363mvin_wchnstr/\fBcurs_in_wchstr\fR(3X)
364mvin_wchstr/\fBcurs_in_wchstr\fR(3X)
365mvinch/\fBcurs_inch\fR(3X)
366mvinchnstr/\fBcurs_inchstr\fR(3X)
367mvinchstr/\fBcurs_inchstr\fR(3X)
368mvinnstr/\fBcurs_instr\fR(3X)
369mvinnwstr/\fBcurs_inwstr\fR(3X)
370mvins_nwstr/\fBcurs_ins_wstr\fR(3X)
371mvins_wch/\fBcurs_ins_wch\fR(3X)
372mvins_wstr/\fBcurs_ins_wstr\fR(3X)
373mvinsch/\fBcurs_insch\fR(3X)
374mvinsnstr/\fBcurs_insstr\fR(3X)
375mvinsstr/\fBcurs_insstr\fR(3X)
376mvinstr/\fBcurs_instr\fR(3X)
377mvinwstr/\fBcurs_inwstr\fR(3X)
378mvprintw/\fBcurs_printw\fR(3X)
379mvscanw/\fBcurs_scanw\fR(3X)
380mvvline/\fBcurs_border\fR(3X)
381mvvline_set/\fBcurs_border_set\fR(3X)
382mvwadd_wch/\fBcurs_add_wch\fR(3X)
383mvwadd_wchnstr/\fBcurs_add_wchstr\fR(3X)
384mvwadd_wchstr/\fBcurs_add_wchstr\fR(3X)
385mvwaddch/\fBcurs_addch\fR(3X)
386mvwaddchnstr/\fBcurs_addchstr\fR(3X)
387mvwaddchstr/\fBcurs_addchstr\fR(3X)
388mvwaddnstr/\fBcurs_addstr\fR(3X)
389mvwaddnwstr/\fBcurs_addwstr\fR(3X)
390mvwaddstr/\fBcurs_addstr\fR(3X)
391mvwaddwstr/\fBcurs_addwstr\fR(3X)
392mvwchgat/\fBcurs_attr\fR(3X)
393mvwdelch/\fBcurs_delch\fR(3X)
394mvwget_wch/\fBcurs_get_wch\fR(3X)
395mvwget_wstr/\fBcurs_get_wstr\fR(3X)
396mvwgetch/\fBcurs_getch\fR(3X)
397mvwgetn_wstr/\fBcurs_get_wstr\fR(3X)
398mvwgetnstr/\fBcurs_getstr\fR(3X)
399mvwgetstr/\fBcurs_getstr\fR(3X)
400mvwhline/\fBcurs_border\fR(3X)
401mvwhline_set/\fBcurs_border_set\fR(3X)
402mvwin/\fBcurs_window\fR(3X)
403mvwin_wch/\fBcurs_in_wch\fR(3X)
404mvwin_wchnstr/\fBcurs_in_wchstr\fR(3X)
405mvwin_wchstr/\fBcurs_in_wchstr\fR(3X)
406mvwinch/\fBcurs_inch\fR(3X)
407mvwinchnstr/\fBcurs_inchstr\fR(3X)
408mvwinchstr/\fBcurs_inchstr\fR(3X)
409mvwinnstr/\fBcurs_instr\fR(3X)
410mvwinnwstr/\fBcurs_inwstr\fR(3X)
411mvwins_nwstr/\fBcurs_ins_wstr\fR(3X)
412mvwins_wch/\fBcurs_ins_wch\fR(3X)
413mvwins_wstr/\fBcurs_ins_wstr\fR(3X)
414mvwinsch/\fBcurs_insch\fR(3X)
415mvwinsnstr/\fBcurs_insstr\fR(3X)
416mvwinsstr/\fBcurs_insstr\fR(3X)
417mvwinstr/\fBcurs_instr\fR(3X)
418mvwinwstr/\fBcurs_inwstr\fR(3X)
419mvwprintw/\fBcurs_printw\fR(3X)
420mvwscanw/\fBcurs_scanw\fR(3X)
421mvwvline/\fBcurs_border\fR(3X)
422mvwvline_set/\fBcurs_border_set\fR(3X)
423napms/\fBcurs_kernel\fR(3X)
424newpad/\fBcurs_pad\fR(3X)
425newterm/\fBcurs_initscr\fR(3X)
426newwin/\fBcurs_window\fR(3X)
427nl/\fBcurs_outopts\fR(3X)
428nocbreak/\fBcurs_inopts\fR(3X)
429nodelay/\fBcurs_inopts\fR(3X)
430noecho/\fBcurs_inopts\fR(3X)
431nonl/\fBcurs_outopts\fR(3X)
432noqiflush/\fBcurs_inopts\fR(3X)
433noraw/\fBcurs_inopts\fR(3X)
434notimeout/\fBcurs_inopts\fR(3X)
435overlay/\fBcurs_overlay\fR(3X)
436overwrite/\fBcurs_overlay\fR(3X)
437pair_content/\fBcurs_color\fR(3X)
438pechochar/\fBcurs_pad\fR(3X)
439pnoutrefresh/\fBcurs_pad\fR(3X)
440prefresh/\fBcurs_pad\fR(3X)
441printw/\fBcurs_printw\fR(3X)
442putp/\fBcurs_terminfo\fR(3X)
443putwin/\fBcurs_util\fR(3X)
444qiflush/\fBcurs_inopts\fR(3X)
445raw/\fBcurs_inopts\fR(3X)
446redrawwin/\fBcurs_refresh\fR(3X)
447refresh/\fBcurs_refresh\fR(3X)
448reset_prog_mode/\fBcurs_kernel\fR(3X)
449reset_shell_mode/\fBcurs_kernel\fR(3X)
450resetty/\fBcurs_kernel\fR(3X)
451resizeterm/\fBresizeterm\fR(3X)*
452restartterm/\fBcurs_terminfo\fR(3X)
453ripoffline/\fBcurs_kernel\fR(3X)
454savetty/\fBcurs_kernel\fR(3X)
455scanw/\fBcurs_scanw\fR(3X)
456scr_dump/\fBcurs_scr_dump\fR(3X)
457scr_init/\fBcurs_scr_dump\fR(3X)
458scr_restore/\fBcurs_scr_dump\fR(3X)
459scr_set/\fBcurs_scr_dump\fR(3X)
460scrl/\fBcurs_scroll\fR(3X)
461scroll/\fBcurs_scroll\fR(3X)
462scrollok/\fBcurs_outopts\fR(3X)
463set_curterm/\fBcurs_terminfo\fR(3X)
464set_term/\fBcurs_initscr\fR(3X)
465setcchar/\fBcurs_getcchar\fR(3X)
466setscrreg/\fBcurs_outopts\fR(3X)
467setsyx/\fBcurs_kernel\fR(3X)
468setterm/\fBcurs_terminfo\fR(3X)
469setupterm/\fBcurs_terminfo\fR(3X)
470slk_attr/\fBcurs_slk\fR(3X)*
471slk_attr_off/\fBcurs_slk\fR(3X)
472slk_attr_on/\fBcurs_slk\fR(3X)
473slk_attr_set/\fBcurs_slk\fR(3X)
474slk_attroff/\fBcurs_slk\fR(3X)
475slk_attron/\fBcurs_slk\fR(3X)
476slk_attrset/\fBcurs_slk\fR(3X)
477slk_clear/\fBcurs_slk\fR(3X)
478slk_color/\fBcurs_slk\fR(3X)
479slk_init/\fBcurs_slk\fR(3X)
480slk_label/\fBcurs_slk\fR(3X)
481slk_noutrefresh/\fBcurs_slk\fR(3X)
482slk_refresh/\fBcurs_slk\fR(3X)
483slk_restore/\fBcurs_slk\fR(3X)
484slk_set/\fBcurs_slk\fR(3X)
485slk_touch/\fBcurs_slk\fR(3X)
486standend/\fBcurs_attr\fR(3X)
487standout/\fBcurs_attr\fR(3X)
488start_color/\fBcurs_color\fR(3X)
489subpad/\fBcurs_pad\fR(3X)
490subwin/\fBcurs_window\fR(3X)
491syncok/\fBcurs_window\fR(3X)
492term_attrs/\fBcurs_termattrs\fR(3X)
493termattrs/\fBcurs_termattrs\fR(3X)
494termname/\fBcurs_termattrs\fR(3X)
495tgetent/\fBcurs_termcap\fR(3X)
496tgetflag/\fBcurs_termcap\fR(3X)
497tgetnum/\fBcurs_termcap\fR(3X)
498tgetstr/\fBcurs_termcap\fR(3X)
499tgoto/\fBcurs_termcap\fR(3X)
500tigetflag/\fBcurs_terminfo\fR(3X)
501tigetnum/\fBcurs_terminfo\fR(3X)
502tigetstr/\fBcurs_terminfo\fR(3X)
503timeout/\fBcurs_inopts\fR(3X)
504touchline/\fBcurs_touch\fR(3X)
505touchwin/\fBcurs_touch\fR(3X)
506tparm/\fBcurs_terminfo\fR(3X)
507tputs/\fBcurs_termcap\fR(3X)
508tputs/\fBcurs_terminfo\fR(3X)
509trace/\fBcurs_trace\fR(3X)*
510typeahead/\fBcurs_inopts\fR(3X)
511unctrl/\fBcurs_util\fR(3X)
512unget_wch/\fBcurs_get_wch\fR(3X)
513ungetch/\fBcurs_getch\fR(3X)
514ungetmouse/\fBcurs_mouse\fR(3X)*
515untouchwin/\fBcurs_touch\fR(3X)
516use_default_colors/\fBdefault_colors\fR(3X)*
517use_env/\fBcurs_util\fR(3X)
518use_extended_names/\fBcurs_extend\fR(3X)*
519vid_attr/\fBcurs_terminfo\fR(3X)
520vid_puts/\fBcurs_terminfo\fR(3X)
521vidattr/\fBcurs_terminfo\fR(3X)
522vidputs/\fBcurs_terminfo\fR(3X)
523vline/\fBcurs_border\fR(3X)
524vline_set/\fBcurs_border_set\fR(3X)
525vw_printw/\fBcurs_printw\fR(3X)
526vw_scanw/\fBcurs_scanw\fR(3X)
527vwprintw/\fBcurs_printw\fR(3X)
528vwscanw/\fBcurs_scanw\fR(3X)
529wadd_wch/\fBcurs_add_wch\fR(3X)
530wadd_wchnstr/\fBcurs_add_wchstr\fR(3X)
531wadd_wchstr/\fBcurs_add_wchstr\fR(3X)
532waddch/\fBcurs_addch\fR(3X)
533waddchnstr/\fBcurs_addchstr\fR(3X)
534waddchstr/\fBcurs_addchstr\fR(3X)
535waddnstr/\fBcurs_addstr\fR(3X)
536waddnwstr/\fBcurs_addwstr\fR(3X)
537waddstr/\fBcurs_addstr\fR(3X)
538waddwstr/\fBcurs_addwstr\fR(3X)
539wattr_get/\fBcurs_attr\fR(3X)
540wattr_off/\fBcurs_attr\fR(3X)
541wattr_on/\fBcurs_attr\fR(3X)
542wattr_set/\fBcurs_attr\fR(3X)
543wattroff/\fBcurs_attr\fR(3X)
544wattron/\fBcurs_attr\fR(3X)
545wattrset/\fBcurs_attr\fR(3X)
546wbkgd/\fBcurs_bkgd\fR(3X)
547wbkgdset/\fBcurs_bkgd\fR(3X)
548wbkgrnd/\fBcurs_bkgrnd\fR(3X)
549wbkgrndset/\fBcurs_bkgrnd\fR(3X)
550wborder/\fBcurs_border\fR(3X)
551wborder_set/\fBcurs_border_set\fR(3X)
552wchgat/\fBcurs_attr\fR(3X)
553wclear/\fBcurs_clear\fR(3X)
554wclrtobot/\fBcurs_clear\fR(3X)
555wclrtoeol/\fBcurs_clear\fR(3X)
556wcolor_set/\fBcurs_attr\fR(3X)
557wcursyncup/\fBcurs_window\fR(3X)
558wdelch/\fBcurs_delch\fR(3X)
559wdeleteln/\fBcurs_deleteln\fR(3X)
560wecho_wchar/\fBcurs_add_wch\fR(3X)
561wechochar/\fBcurs_addch\fR(3X)
562wenclose/\fBcurs_mouse\fR(3X)*
563werase/\fBcurs_clear\fR(3X)
564wget_wch/\fBcurs_get_wch\fR(3X)
565wget_wstr/\fBcurs_get_wstr\fR(3X)
566wgetbkgrnd/\fBcurs_bkgrnd\fR(3X)
567wgetch/\fBcurs_getch\fR(3X)
568wgetn_wstr/\fBcurs_get_wstr\fR(3X)
569wgetnstr/\fBcurs_getstr\fR(3X)
570wgetstr/\fBcurs_getstr\fR(3X)
571whline/\fBcurs_border\fR(3X)
572whline_set/\fBcurs_border_set\fR(3X)
573win_wch/\fBcurs_in_wch\fR(3X)
574win_wchnstr/\fBcurs_in_wchstr\fR(3X)
575win_wchstr/\fBcurs_in_wchstr\fR(3X)
576winch/\fBcurs_inch\fR(3X)
577winchnstr/\fBcurs_inchstr\fR(3X)
578winchstr/\fBcurs_inchstr\fR(3X)
579winnstr/\fBcurs_instr\fR(3X)
580winnwstr/\fBcurs_inwstr\fR(3X)
581wins_nwstr/\fBcurs_ins_wstr\fR(3X)
582wins_wch/\fBcurs_ins_wch\fR(3X)
583wins_wstr/\fBcurs_ins_wstr\fR(3X)
584winsch/\fBcurs_insch\fR(3X)
585winsdelln/\fBcurs_deleteln\fR(3X)
586winsertln/\fBcurs_deleteln\fR(3X)
587winsnstr/\fBcurs_insstr\fR(3X)
588winsstr/\fBcurs_insstr\fR(3X)
589winstr/\fBcurs_instr\fR(3X)
590winwstr/\fBcurs_inwstr\fR(3X)
591wmouse_trafo/\fBcurs_mouse\fR(3X)*
592wmove/\fBcurs_move\fR(3X)
593wnoutrefresh/\fBcurs_refresh\fR(3X)
594wprintw/\fBcurs_printw\fR(3X)
595wredrawln/\fBcurs_refresh\fR(3X)
596wrefresh/\fBcurs_refresh\fR(3X)
597wresize/\fBwresize\fR(3X)*
598wscanw/\fBcurs_scanw\fR(3X)
599wscrl/\fBcurs_scroll\fR(3X)
600wsetscrreg/\fBcurs_outopts\fR(3X)
601wstandend/\fBcurs_attr\fR(3X)
602wstandout/\fBcurs_attr\fR(3X)
603wsyncdown/\fBcurs_window\fR(3X)
604wsyncup/\fBcurs_window\fR(3X)
605wtimeout/\fBcurs_inopts\fR(3X)
606wtouchln/\fBcurs_touch\fR(3X)
607wunctrl/\fBcurs_util\fR(3X)
608wvline/\fBcurs_border\fR(3X)
609wvline_set/\fBcurs_border_set\fR(3X)
610.TE
611.SH RETURN VALUE
612Routines that return an integer return \fBERR\fR upon failure and an
613integer value other than \fBERR\fR upon successful completion, unless
614otherwise noted in the routine descriptions.
615.PP
616All macros return the value of the \fBw\fR version, except \fBsetscrreg\fR,
617\fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and \fBgetmaxyx\fR. The return
618values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and
619\fBgetmaxyx\fR are undefined (i.e., these should not be used as the
620right-hand side of assignment statements).
621.PP
622Routines that return pointers return \fBNULL\fR on error.
623.SH ENVIRONMENT
624The following environment symbols are useful for customizing the
625runtime behavior of the \fBncurses\fR library. The most important
626ones have been already discussed in detail.
627.TP 5
628BAUDRATE
629The debugging library checks this environment symbol when the application
630has redirected output to a file.
631The symbol's numeric value is used for the baudrate.
632If no value is found, \fBncurses\fR uses 9600.
633This allows testers to construct repeatable test-cases
634that take into account costs that depend on baudrate.
635.TP 5
636CC
637When set, change occurrences of the command_character
638(i.e., the \fBcmdch\fP capability)
639of the loaded terminfo entries to the value of this symbol.
640Very few terminfo entries provide this feature.
641.TP 5
642COLUMNS
643Specify the width of the screen in characters.
644Applications running in a windowing environment usually are able to
645obtain the width of the window in which they are executing.
646If neither the \fBCOLUMNS\fP value nor the terminal's screen size is available,
647\fBncurses\fR uses the size which may be specified in the terminfo database
648(i.e., the \fBcols\fR capability).
649.IP
650It is important that your application use a correct size for the screen.
651This is not always possible because your application may be
652running on a host which does not honor NAWS (Negotiations About Window
653Size), or because you are temporarily running as another user.
654However, setting \fBCOLUMNS\fP and/or \fBLINES\fP overrides the library's
655use of the screen size obtained from the operating system.
656.IP
657Either \fBCOLUMNS\fP or \fBLINES\fP symbols may be specified independently.
658This is mainly useful to circumvent legacy misfeatures of terminal descriptions,
659e.g., xterm which commonly specifies a 65 line screen.
660For best results, \fBlines\fR and \fBcols\fR should not be specified in
661a terminal description for terminals which are run as emulations.
662.IP
663Use the \fBuse_env\fR function to disable all use of external environment
664(including system calls) to determine the screen size.
665.TP 5
666ESCDELAY
667Specifies the total time, in milliseconds, for which ncurses will
668await a character sequence, e.g., a function key.
669The default value, 1000 milliseconds, is enough for most uses.
670However, it is made a variable to accommodate unusual applications.
671.IP
672The most common instance where you may wish to change this value
673is to work with slow hosts, e.g., running on a network.
674If the host cannot read characters rapidly enough, it will have the same
675effect as if the terminal did not send characters rapidly enough.
676The library will still see a timeout.
677.IP
678Note that xterm mouse events are built up from character sequences
679received from the xterm.
680If your application makes heavy use of multiple-clicking, you may
681wish to lengthen this default value because the timeout applies
682to the composed multi-click event as well as the individual clicks.
683.IP
684In addition to the environment variable,
685this implementation provides a global variable with the same name.
686Portable applications should not rely upon the presence of ESCDELAY
687in either form,
688but setting the environment variable rather than the global variable
689does not create problems when compiling an application.
690.TP 5
691HOME
692Tells \fBncurses\fR where your home directory is.
693That is where it may read and write auxiliary terminal descriptions:
694.IP
695$HOME/.termcap
696.br
697$HOME/.terminfo
698.TP 5
699LINES
700Like COLUMNS, specify the height of the screen in characters.
701See COLUMNS for a detailed description.
702.TP 5
703MOUSE_BUTTONS_123
704This applies only to the OS/2 EMX port.
705It specifies the order of buttons on the mouse.
706OS/2 numbers a 3-button mouse inconsistently from other
707platforms:
708.sp
7091 = left
710.br
7112 = right
712.br
7133 = middle.
714.sp
715This symbol lets you customize the mouse.
716The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321.
717If it is not specified, \fBncurses\fR uses 132.
718.TP 5
719NCURSES_ASSUMED_COLORS
720Override the compiled-in assumption that the
721terminal's default colors are white-on-black
722(see \fBassume_default_colors\fR(3X)).
723You may set the foreground and background color values with this environment
724variable by proving a 2-element list: foreground,background.
725For example, to tell ncurses to not assume anything
726about the colors, set this to "-1,-1".
727To make it green-on-black, set it to "2,0".
728Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed.
729.TP 5
730NCURSES_NO_PADDING
731Most of the terminal descriptions in the terminfo database are written
732for real "hardware" terminals.
733Many people use terminal emulators
734which run in a windowing environment and use curses-based applications.
735Terminal emulators can duplicate
736all of the important aspects of a hardware terminal, but they do not
737have the same limitations.
738The chief limitation of a hardware terminal from the standpoint
739of your application is the management of dataflow, i.e., timing.
740Unless a hardware terminal is interfaced into a terminal concentrator
741(which does flow control),
742it (or your application) must manage dataflow, preventing overruns.
743The cheapest solution (no hardware cost)
744is for your program to do this by pausing after
745operations that the terminal does slowly, such as clearing the display.
746.IP
747As a result, many terminal descriptions (including the vt100)
748have delay times embedded. You may wish to use these descriptions,
749but not want to pay the performance penalty.
750.IP
751Set the NCURSES_NO_PADDING symbol to disable all but mandatory
752padding. Mandatory padding is used as a part of special control
753sequences such as \fIflash\fR.
754.TP 5
755NCURSES_NO_SETBUF
756Normally \fBncurses\fR enables buffered output during terminal initialization.
757This is done (as in SVr4 curses) for performance reasons.
758For testing purposes, both of \fBncurses\fR and certain applications,
759this feature is made optional. Setting the NCURSES_NO_SETBUF variable
760disables output buffering, leaving the output in the original (usually
761line buffered) mode.
762.TP 5
763NCURSES_NO_UTF8_ACS
764During initialization, the \fBncurses\fR library
765checks for special cases where VT100 line-drawing (and the corresponding
766alternate character set capabilities) described in the terminfo are known
767to be missing.
768Specifically, when running in a UTF-8 locale,
769the Linux console emulator and the GNU screen program ignore these.
770Ncurses checks the TERM environment variable for these.
771For other special cases, you should set this environment variable.
772Doing this tells ncurses to use Unicode values which correspond to
773the VT100 line-drawing glyphs.
774That works for the special cases cited,
775and is likely to work for terminal emulators.
776.IP
777When setting this variable, you should set it to a nonzero value.
778Setting it to zero (or to a nonnumber)
779disables the special check for Linux and screen.
780.TP 5
781NCURSES_TRACE
782During initialization, the \fBncurses\fR debugging library
783checks the NCURSES_TRACE symbol.
784If it is defined, to a numeric value, \fBncurses\fR calls the \fBtrace\fR
785function, using that value as the argument.
786.IP
787The argument values, which are defined in \fBcurses.h\fR, provide several
788types of information.
789When running with traces enabled, your application will write the
790file \fBtrace\fR to the current directory.
791.TP 5
792TERM
793Denotes your terminal type.
794Each terminal type is distinct, though many are similar.
795.TP 5
796TERMCAP
797If the \fBncurses\fR library has been configured with \fItermcap\fR
798support, \fBncurses\fR will check for a terminal's description in
799termcap form if it is not available in the terminfo database.
800.IP
801The TERMCAP symbol contains either a terminal description (with
802newlines stripped out),
803or a file name telling where the information denoted by the TERM symbol exists.
804In either case, setting it directs \fBncurses\fR to ignore
805the usual place for this information, e.g., /etc/termcap.
806.TP 5
807TERMINFO
808Overrides the directory in which \fBncurses\fR searches for your terminal
809description.
810This is the simplest, but not the only way to change the list of directories.
811The complete list of directories in order follows:
812.RS
813.TP 3
814-
815the last directory to which \fBncurses\fR wrote, if any, is searched first
816.TP 3
817-
818the directory specified by the TERMINFO symbol
819.TP 3
820-
821$HOME/.terminfo
822.TP 3
823-
824directories listed in the TERMINFO_DIRS symbol
825.TP 3
826-
827one or more directories whose names are configured and compiled into the
828ncurses library, e.g.,
829@TERMINFO@
830.RE
831.TP 5
832TERMINFO_DIRS
833Specifies a list of directories to search for terminal descriptions.
834The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
835All of the terminal descriptions are in terminfo form, which makes
836a subdirectory named for the first letter of the terminal names therein.
837.TP 5
838TERMPATH
839If TERMCAP does not hold a file name then \fBncurses\fR checks
840the TERMPATH symbol.
841This is a list of filenames separated by spaces or colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
842If the TERMPATH symbol is not set, \fBncurses\fR looks in the files
843/etc/termcap, /usr/share/misc/termcap and $HOME/.termcap, in that order.
844.PP
845The library may be configured to disregard the following variables when the
846current user is the superuser (root), or if the application uses setuid or
847setgid permissions:
848$TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
849.SH FILES
850.TP 5
851@DATADIR@/tabset
852directory containing initialization files for the terminal capability database
853@TERMINFO@
854terminal capability database
855.SH SEE ALSO
856\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine
857descriptions.
858.SH EXTENSIONS
859The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR)
860that falls back to the old-style /etc/termcap file if the terminal setup code
861cannot find a terminfo entry corresponding to \fBTERM\fR. Use of this feature
862is not recommended, as it essentially includes an entire termcap compiler in
863the \fBncurses\fR startup code, at significant cost in core and startup cycles.
864.PP
865The \fBncurses\fR library includes facilities for capturing mouse events on
866certain terminals (including xterm). See the \fBcurs_mouse\fR(3X)
867manual page for details.
868.PP
869The \fBncurses\fR library includes facilities for responding to window
870resizing events, e.g., when running in an xterm.
871See the \fBresizeterm\fR(3X)
872and \fBwresize\fR(3X) manual pages for details.
873In addition, the library may be configured with a SIGWINCH handler.
874.PP
875The \fBncurses\fR library extends the fixed set of function key capabilities
876of terminals by allowing the application designer to define additional
877key sequences at runtime.
878See the \fBdefine_key\fR(3X)
879\fBkey_defined\fR(3X),
880and \fBkeyok\fR(3X) manual pages for details.
881.PP
882The \fBncurses\fR library can exploit the capabilities of terminals which
883implement the ISO-6429 SGR 39 and SGR 49 controls, which allow an application
884to reset the terminal to its original foreground and background colors.
885From the users' perspective, the application is able to draw colored
886text on a background whose color is set independently, providing better
887control over color contrasts.
888See the \fBdefault_colors\fR(3X) manual page for details.
889.PP
890The \fBncurses\fR library includes a function for directing application output
891to a printer attached to the terminal device. See the \fBcurs_print\fR(3X)
892manual page for details.
893.SH PORTABILITY
894The \fBncurses\fR library is intended to be BASE-level conformant with the XSI
895Curses standard. The EXTENDED XSI Curses functionality
896(including color support) is supported.
897.PP
898A small number of local differences (that is, individual differences between
899the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR
900sections of the library man pages.
901.PP
902The routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4. See
903the \fBcurs_getch\fR(3X) manual page for details.
904.PP
905The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4. See
906the \fBcurs_slk\fR(3X) manual page for details.
907.PP
908The routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,
909\fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are not
910part of XPG4, nor are they present in SVr4. See the \fBcurs_mouse\fR(3X)
911manual page for details.
912.PP
913The routine \fBmcprint\fR was not present in any previous curses
914implementation. See the \fBcurs_print\fR(3X) manual page for details.
915.PP
916The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4. See
917the \fBwresize\fR(3X) manual page for details.
918.PP
919In historic curses versions, delays embedded in the capabilities \fBcr\fR,
920\fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delay
921bits in the UNIX tty driver. In this implementation, all padding is done by
922NUL sends. This method is slightly more expensive, but narrows the interface
923to the UNIX kernel significantly and increases the package's portability
924correspondingly.
925.SH NOTES
926The header file \fB<curses.h>\fR automatically includes the header files
927\fB<stdio.h>\fR and \fB<unctrl.h>\fR.
928.PP
929If standard output from a \fBncurses\fR program is re-directed to something
930which is not a tty, screen updates will be directed to standard error. This
931was an undocumented feature of AT&T System V Release 3 curses.
932.SH AUTHORS
933Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
934Based on pcurses by Pavel Curtis.
935.\"#
936.\"# The following sets edit modes for GNU EMACS
937.\"# Local Variables:
938.\"# mode:nroff
939.\"# fill-column:79
940.\"# End:
Note: See TracBrowser for help on using the repository browser.