2 .\"***************************************************************************
3 .\" Copyright 2018-2023,2024 Thomas E. Dickey *
4 .\" Copyright 1998-2015,2017 Free Software Foundation, Inc. *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a *
7 .\" copy of this software and associated documentation files (the *
8 .\" "Software"), to deal in the Software without restriction, including *
9 .\" without limitation the rights to use, copy, modify, merge, publish, *
10 .\" distribute, distribute with modifications, sublicense, and/or sell *
11 .\" copies of the Software, and to permit persons to whom the Software is *
12 .\" furnished to do so, subject to the following conditions: *
14 .\" The above copyright notice and this permission notice shall be included *
15 .\" in all copies or substantial portions of the Software. *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25 .\" Except as contained in this notice, the name(s) of the above copyright *
26 .\" holders shall not be used in advertising or otherwise to promote the *
27 .\" sale, use or other dealings in this Software without prior written *
29 .\"***************************************************************************
31 .\" $Id: ncurses.3x,v 1.210 2024/04/20 21:24:19 tom Exp $
32 .TH ncurses 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
49 .\" Add supplementary paragraph tag on its own line after TP.
50 .\" Adapted from TQ (which would produce mandoc warnings).
60 character-cell terminal interface with optimized output
63 \fB#include <curses.h>
66 The \*(``new curses\*('' library offers the programmer a
67 terminal-independent means of reading keyboard and mouse input and
68 updating character-cell terminals with output optimized to minimize
74 System V Release 4 Unix (\*(``SVr4\*('')
77 the development of which ceased in the 1990s.
78 This document describes
80 version @NCURSES_MAJOR@.@NCURSES_MINOR@
81 (patch @NCURSES_PATCH@).
84 permits control of the terminal screen's contents;
85 abstraction and subdivision thereof with
89 the reading of terminal input;
90 control of terminal input and output options;
91 environment query routines;
93 the definition and use of
100 compatibility interface;
101 and an abstraction of the system's API for manipulating the terminal
102 (such as \fI\%termios\fP(3)).
105 implements the standard interface described by
106 X/Open Curses Issue\ 7.
107 In many behavioral details not standardized by X/Open,
111 library of SVr4 and provides numerous useful extensions.
114 man pages employ several sections to clarify matters of usage and
115 interoperability with other
119 \*(``NOTES\*('' describes issues and caveats of which any user of the
122 such as limitations on the size of an underlying integral type or the
123 availability of a preprocessor macro exclusive of a function definition
124 (which prevents its address from being taken).
125 This section also describes implementation details that will be
126 significant to the programmer but which are not standardized.
128 \*(``EXTENSIONS\*('' presents
130 innovations beyond the X/Open Curses standard and/or the SVr4
135 to indicate that they cannot be implemented solely by using the library
137 but require access to the library's internal state.
139 \*(``PORTABILITY\*('' discusses matters
140 (beyond the exercise of extensions)
141 that should be considered when writing to a
144 or for multiple implementations.
146 \*(``HISTORY\*('' examines points of detail in
150 implementations over the decades of their development,
151 particularly where precedent or inertia have frustrated better design
154 where such inertia has been overcome).
158 application must be linked with the library;
161 option to your compiler or linker.
162 A debugging version of the library may be available;
166 (Your system integrator may have installed these libraries such that you
174 library generates trace logs
177 in the current directory)
181 See section \*(``ALTERNATE CONFIGURATIONS\*('' below.
182 .SS "Application Structure"
185 application uses information from the system locale;
186 \fI\%setlocale\fP(3) prepares it for
192 setlocale(LC_ALL, "");
196 If the locale is not thus initialized,
197 the library assumes that characters are printable as in ISO\ 8859-1,
198 to work with certain legacy programs.
199 You should initialize the locale;
200 do not expect consistent behavior from the library when the locale has
203 \fB\%initscr\fP(3X) or \fB\%newterm\fP(3X)
204 must be called to initialize
206 before use of any functions that deal with windows and screens.
208 To get character-at-a-time input without echoing\(emmost interactive,
209 screen-oriented programs want this\(emuse the following sequence.
213 initscr(); cbreak(); noecho();
217 Most applications perform further setup as follows.
221 intrflush(stdscr, FALSE);
222 keypad(stdscr, TRUE);
228 program then often enters an event loop of some sort.
229 Call \fB\%endwin\fP(3X) before exiting.
233 library abstracts the terminal screen by representing all or part of it
239 is a rectangular grid of character cells,
240 addressed by row and column coordinates
243 with the upper left corner as (0, 0).
246 the same size as the terminal screen,
248 Create others with \fB\%newwin\fP(3X).
252 library does not manage overlapping windows
256 to manage one screen-filling window,
257 or tile the screen into non-overlapping windows and not use
260 Mixing the two approaches will result in unpredictable and undesired
263 Functions permit manipulation of a window and the
265 identifying the cell within it at which the next output operation will
268 the most basic are \fB\%move\fP(3X) and \fB\%addch\fP(3X):
269 these place the cursor and write a character to
273 Frequent changes to the terminal screen can cause unpleasant flicker or
274 inefficient use of the communication channel to the device,
275 so the library does not generally update it automatically.
279 functions to accumulate a set of desired updates that make sense to
281 call \fB\%refresh\fP(3X) to tell the library to make the user's screen
282 look like \fBstdscr\fP.
284 .\" X/Open Curses Issue 7 assumes some optimization will be done, but
285 .\" does not mandate it in any way.
287 its output by computing a minimal number of operations to mutate the
288 screen from its state at the previous refresh to the new one.
289 Effective optimization demands accurate information about the terminal
291 the management of such information is the province of the
292 \fB\%terminfo\fP(3X) API,
293 a feature of every standard
297 Special windows called
299 may also be manipulated.
300 These are windows that are not constrained to the size of the terminal
301 screen and whose contents need not be completely displayed.
302 See \fB\%curs_pad\fP(3X).
304 In addition to drawing characters on the screen,
305 rendering attributes and colors may be supported,
306 causing the characters to show up in such modes as underlined,
308 or in color on terminals that support such display enhancements.
309 See \fB\%curs_attr\fP(3X).
312 predefines constants for a small set of forms-drawing graphics
313 corresponding to the DEC Alternate Character Set (ACS),
314 a feature of VT100 and other terminals.
315 See \fB\%waddch\fP(3X).
318 is implemented using the operating system's terminal driver;
319 keystroke events are received not as scan codes but as byte sequences.
321 (alphanumeric and punctuation keys,
330 appears as a control character or a multibyte
331 .I "escape sequence."
333 translates these into unique
335 See \fB\%getch\fP(3X).
338 provides reimplementations of the SVr4 \fBpanel\fP(3X), \fBform\fP(3X),
339 and \fBmenu\fP(3X) libraries to ease construction of user interfaces
343 The selection of an appropriate value of
345 in the process environment is essential to correct
350 A well-configured system selects a correct
353 \fB\%tset\fP(1) may assist with troubleshooting exotic situations.
355 If you change the terminal type,
358 environment variable in the shell,
359 then run \fB\%tset\fP(1) or the
360 .RB \*(`` "@TPUT@ init" \*(''
362 See subsection \*(``Tabs and Initialization\*('' of \fB\%terminfo\fP(5).
364 If the environment variables
371 program is executing in a graphical windowing environment,
372 the information obtained thence overrides that obtained by
376 extension supports resizable terminals;
377 see \fB\%wresize\fP(3X).
379 If the environment variable
384 program checks first for a terminal type description in the location it
387 is useful for developing experimental type descriptions or when write
392 See section \*(``ENVIRONMENT\*('' below.
393 .SS "Naming Conventions"
395 offers many functions in variant forms using a regular set of
396 alternatives to the name of an elemental one.
397 Those prefixed with \*(``w\*('' require a
400 those with a \*(``mv\*('' prefix first perform cursor movement using
402 a \*(``mvw\*('' prefix indicates both.
403 The \*(``w\*('' function is typically the elemental one;
404 the removal of this prefix usually indicates operation on
407 Four functions prefixed with \*(``p\*('' require a pad argument.
409 In function synopses,
411 man pages apply the following names to parameters.
416 bf \fIbool\fP (\fBTRUE\fP or \fBFALSE\fP)
417 c a \fIchar\fP or \fIint\fP
419 wc a \fIwchar_t\fP or \fIwint_t\fP
421 win pointer to a \fIWINDOW\fP
422 pad pointer to a \fIWINDOW\fP that is a pad
424 .SS "Wide and Non-wide Character Configurations"
425 This manual page describes functions that appear in any configuration
427 There are two common configurations;
428 see section \*(``ALTERNATE CONFIGURATIONS\*('' below.
429 .TP 10 \" "ncursesw" + 2n
431 is the library in its \*(``non-wide\*('' configuration,
432 handling only eight-bit characters.
433 It stores a character combined with attributes in a
436 which is often an alias of
440 (with no corresponding character)
441 can be stored in variables of
447 they are represented as an integral bit mask.
455 is the library in its \*(``wide\*('' configuration,
456 which handles character encodings requiring a larger data type than
460 It adds about one third more calls using additional data types that
464 .RS 10 \" same as foregoing tag width
465 .TP 9 \" "cchar_t" + 2n
467 corresponds to the non-wide configuration's
469 It always a structure type,
470 because it stores more data than fit into a standard scalar type.
471 A character code may not be representable as a
473 and moreover more than one character may occupy a cell
474 (as with accent marks and other diacritics).
475 Each character is of type
477 a complex character contains one spacing character and zero or more
478 non-spacing characters
480 Attributes and color data are stored in separate fields of the
490 \fB\%setcchar\fP(3X) and \fB\%getcchar\fP(3X)
494 The wide library API of
496 depends on two data types standardized by ISO C95.
499 stores a wide character.
502 it may be an alias of
504 Depending on the character encoding,
505 a wide character may be
507 meaning that it occupies a character cell by itself and typically
508 accompanies cursor advancement,
511 meaning that it occupies the same cell as a spacing character,
512 is often regarded as a \*(``modifier\*('' of the base glyph with which
514 and typically does not advance the cursor.
523 character manipulation functions of ISO C and its constant
527 The wide library provides additional functions that complement those in
528 the non-wide library where the size of the underlying character type is
530 A somewhat regular naming convention relates many of the wide variants
531 to their non-wide counterparts;
532 where a non-wide function name contains \*(``ch\*('' or \*(``str\*('',
533 prefix it with \*(``_w\*('' to obtain the wide counterpart.
535 \fB\%waddch\fP becomes \fB\%wadd_wch\fP.
536 (Exceptions that add only \*(``w\*('' comprise
541 This convention is inapplicable to some non-wide function names,
542 so other transformations are used for the wide configuration:
543 the window background management function \*(``bkgd\*('' becomes
545 the window border-drawing and -clearing functions are suffixed with
547 and character attribute manipulation functions like
548 \*(``attron\*('' become \*(``attr_on\*(''.
550 .SS "Function Name Index"
551 The following table lists the
553 functions provided in the non-wide and wide APIs and the corresponding
554 man pages that describe them.
555 Those flagged with \*(``*\*(''
557 .IR \%ncurses "-specific,"
558 neither described by X/Open Curses nor present in SVr4.
563 \f(BIcurses\fP Function Name/Man Page
565 COLOR_PAIR/\fBcurs_color\fP(3X)
566 PAIR_NUMBER/\fBcurs_color\fP(3X)
567 add_wch/\fBcurs_add_wch\fP(3X)
568 add_wchnstr/\fBcurs_add_wchstr\fP(3X)
569 add_wchstr/\fBcurs_add_wchstr\fP(3X)
570 addch/\fBcurs_addch\fP(3X)
571 addchnstr/\fBcurs_addchstr\fP(3X)
572 addchstr/\fBcurs_addchstr\fP(3X)
573 addnstr/\fBcurs_addstr\fP(3X)
574 addnwstr/\fBcurs_addwstr\fP(3X)
575 addstr/\fBcurs_addstr\fP(3X)
576 addwstr/\fBcurs_addwstr\fP(3X)
577 alloc_pair/\fBnew_pair\fP(3X)*
578 assume_default_colors/\fBdefault_colors\fP(3X)*
579 attr_get/\fBcurs_attr\fP(3X)
580 attr_off/\fBcurs_attr\fP(3X)
581 attr_on/\fBcurs_attr\fP(3X)
582 attr_set/\fBcurs_attr\fP(3X)
583 attroff/\fBcurs_attr\fP(3X)
584 attron/\fBcurs_attr\fP(3X)
585 attrset/\fBcurs_attr\fP(3X)
586 baudrate/\fBcurs_termattrs\fP(3X)
587 beep/\fBcurs_beep\fP(3X)
588 bkgd/\fBcurs_bkgd\fP(3X)
589 bkgdset/\fBcurs_bkgd\fP(3X)
590 bkgrnd/\fBcurs_bkgrnd\fP(3X)
591 bkgrndset/\fBcurs_bkgrnd\fP(3X)
592 border/\fBcurs_border\fP(3X)
593 border_set/\fBcurs_border_set\fP(3X)
594 box/\fBcurs_border\fP(3X)
595 box_set/\fBcurs_border_set\fP(3X)
596 can_change_color/\fBcurs_color\fP(3X)
597 cbreak/\fBcurs_inopts\fP(3X)
598 chgat/\fBcurs_attr\fP(3X)
599 clear/\fBcurs_clear\fP(3X)
600 clearok/\fBcurs_outopts\fP(3X)
601 clrtobot/\fBcurs_clear\fP(3X)
602 clrtoeol/\fBcurs_clear\fP(3X)
603 color_content/\fBcurs_color\fP(3X)
604 color_set/\fBcurs_attr\fP(3X)
605 copywin/\fBcurs_overlay\fP(3X)
606 curs_set/\fBcurs_kernel\fP(3X)
607 curses_trace/\fBcurs_trace\fP(3X)*
608 curses_version/\fBcurs_extend\fP(3X)*
609 def_prog_mode/\fBcurs_kernel\fP(3X)
610 def_shell_mode/\fBcurs_kernel\fP(3X)
611 define_key/\fBdefine_key\fP(3X)*
612 del_curterm/\fBcurs_terminfo\fP(3X)
613 delay_output/\fBcurs_util\fP(3X)
614 delch/\fBcurs_delch\fP(3X)
615 deleteln/\fBcurs_deleteln\fP(3X)
616 delscreen/\fBcurs_initscr\fP(3X)
617 delwin/\fBcurs_window\fP(3X)
618 derwin/\fBcurs_window\fP(3X)
619 doupdate/\fBcurs_refresh\fP(3X)
620 dupwin/\fBcurs_window\fP(3X)
621 echo/\fBcurs_inopts\fP(3X)
622 echo_wchar/\fBcurs_add_wch\fP(3X)
623 echochar/\fBcurs_addch\fP(3X)
624 endwin/\fBcurs_initscr\fP(3X)
625 erase/\fBcurs_clear\fP(3X)
626 erasechar/\fBcurs_termattrs\fP(3X)
627 erasewchar/\fBcurs_termattrs\fP(3X)
628 exit_curses/\fBcurs_memleaks\fP(3X)*
629 exit_terminfo/\fBcurs_memleaks\fP(3X)*
630 extended_color_content/\fBcurs_color\fP(3X)*
631 extended_pair_content/\fBcurs_color\fP(3X)*
632 extended_slk_color/\fBcurs_slk\fP(3X)*
633 filter/\fBcurs_util\fP(3X)
634 find_pair/\fBnew_pair\fP(3X)*
635 flash/\fBcurs_beep\fP(3X)
636 flushinp/\fBcurs_util\fP(3X)
637 free_pair/\fBnew_pair\fP(3X)*
638 get_escdelay/\fBcurs_threads\fP(3X)*
639 get_wch/\fBcurs_get_wch\fP(3X)
640 get_wstr/\fBcurs_get_wstr\fP(3X)
641 getattrs/\fBcurs_attr\fP(3X)
642 getbegx/\fBcurs_legacy\fP(3X)*
643 getbegy/\fBcurs_legacy\fP(3X)*
644 getbegyx/\fBcurs_getyx\fP(3X)
645 getbkgd/\fBcurs_bkgd\fP(3X)
646 getbkgrnd/\fBcurs_bkgrnd\fP(3X)
647 getcchar/\fBcurs_getcchar\fP(3X)
648 getch/\fBcurs_getch\fP(3X)
649 getcurx/\fBcurs_legacy\fP(3X)*
650 getcury/\fBcurs_legacy\fP(3X)*
651 getmaxx/\fBcurs_legacy\fP(3X)*
652 getmaxy/\fBcurs_legacy\fP(3X)*
653 getmaxyx/\fBcurs_getyx\fP(3X)
654 getmouse/\fBcurs_mouse\fP(3X)*
655 getn_wstr/\fBcurs_get_wstr\fP(3X)
656 getnstr/\fBcurs_getstr\fP(3X)
657 getparx/\fBcurs_legacy\fP(3X)*
658 getpary/\fBcurs_legacy\fP(3X)*
659 getparyx/\fBcurs_getyx\fP(3X)
660 getstr/\fBcurs_getstr\fP(3X)
661 getsyx/\fBcurs_kernel\fP(3X)
662 getwin/\fBcurs_util\fP(3X)
663 getyx/\fBcurs_getyx\fP(3X)
664 halfdelay/\fBcurs_inopts\fP(3X)
665 has_colors/\fBcurs_color\fP(3X)
666 has_ic/\fBcurs_termattrs\fP(3X)
667 has_il/\fBcurs_termattrs\fP(3X)
668 has_key/\fBcurs_getch\fP(3X)*
669 has_mouse/\fBcurs_mouse\fP(3X)*
670 hline/\fBcurs_border\fP(3X)
671 hline_set/\fBcurs_border_set\fP(3X)
672 idcok/\fBcurs_outopts\fP(3X)
673 idlok/\fBcurs_outopts\fP(3X)
674 immedok/\fBcurs_outopts\fP(3X)
675 in_wch/\fBcurs_in_wch\fP(3X)
676 in_wchnstr/\fBcurs_in_wchstr\fP(3X)
677 in_wchstr/\fBcurs_in_wchstr\fP(3X)
678 inch/\fBcurs_inch\fP(3X)
679 inchnstr/\fBcurs_inchstr\fP(3X)
680 inchstr/\fBcurs_inchstr\fP(3X)
681 init_color/\fBcurs_color\fP(3X)
682 init_extended_color/\fBcurs_color\fP(3X)*
683 init_extended_pair/\fBcurs_color\fP(3X)*
684 init_pair/\fBcurs_color\fP(3X)
685 initscr/\fBcurs_initscr\fP(3X)
686 innstr/\fBcurs_instr\fP(3X)
687 innwstr/\fBcurs_inwstr\fP(3X)
688 ins_nwstr/\fBcurs_ins_wstr\fP(3X)
689 ins_wch/\fBcurs_ins_wch\fP(3X)
690 ins_wstr/\fBcurs_ins_wstr\fP(3X)
691 insch/\fBcurs_insch\fP(3X)
692 insdelln/\fBcurs_deleteln\fP(3X)
693 insertln/\fBcurs_deleteln\fP(3X)
694 insnstr/\fBcurs_insstr\fP(3X)
695 insstr/\fBcurs_insstr\fP(3X)
696 instr/\fBcurs_instr\fP(3X)
697 intrflush/\fBcurs_inopts\fP(3X)
698 inwstr/\fBcurs_inwstr\fP(3X)
699 is_cbreak/\fBcurs_inopts\fP(3X)*
700 is_cleared/\fBcurs_opaque\fP(3X)*
701 is_echo/\fBcurs_inopts\fP(3X)*
702 is_idcok/\fBcurs_opaque\fP(3X)*
703 is_idlok/\fBcurs_opaque\fP(3X)*
704 is_immedok/\fBcurs_opaque\fP(3X)*
705 is_keypad/\fBcurs_opaque\fP(3X)*
706 is_leaveok/\fBcurs_opaque\fP(3X)*
707 is_linetouched/\fBcurs_touch\fP(3X)
708 is_nl/\fBcurs_inopts\fP(3X)*
709 is_nodelay/\fBcurs_opaque\fP(3X)*
710 is_notimeout/\fBcurs_opaque\fP(3X)*
711 is_pad/\fBcurs_opaque\fP(3X)*
712 is_raw/\fBcurs_inopts\fP(3X)*
713 is_scrollok/\fBcurs_opaque\fP(3X)*
714 is_subwin/\fBcurs_opaque\fP(3X)*
715 is_syncok/\fBcurs_opaque\fP(3X)*
716 is_term_resized/\fBresizeterm\fP(3X)*
717 is_wintouched/\fBcurs_touch\fP(3X)
718 isendwin/\fBcurs_initscr\fP(3X)
719 key_defined/\fBkey_defined\fP(3X)*
720 key_name/\fBcurs_util\fP(3X)
721 keybound/\fBkeybound\fP(3X)*
722 keyname/\fBcurs_util\fP(3X)
723 keyok/\fBkeyok\fP(3X)*
724 keypad/\fBcurs_inopts\fP(3X)
725 killchar/\fBcurs_termattrs\fP(3X)
726 killwchar/\fBcurs_termattrs\fP(3X)
727 leaveok/\fBcurs_outopts\fP(3X)
728 longname/\fBcurs_termattrs\fP(3X)
729 mcprint/\fBcurs_print\fP(3X)*
730 meta/\fBcurs_inopts\fP(3X)
731 mouse_trafo/\fBcurs_mouse\fP(3X)*
732 mouseinterval/\fBcurs_mouse\fP(3X)*
733 mousemask/\fBcurs_mouse\fP(3X)*
734 move/\fBcurs_move\fP(3X)
735 mvadd_wch/\fBcurs_add_wch\fP(3X)
736 mvadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
737 mvadd_wchstr/\fBcurs_add_wchstr\fP(3X)
738 mvaddch/\fBcurs_addch\fP(3X)
739 mvaddchnstr/\fBcurs_addchstr\fP(3X)
740 mvaddchstr/\fBcurs_addchstr\fP(3X)
741 mvaddnstr/\fBcurs_addstr\fP(3X)
742 mvaddnwstr/\fBcurs_addwstr\fP(3X)
743 mvaddstr/\fBcurs_addstr\fP(3X)
744 mvaddwstr/\fBcurs_addwstr\fP(3X)
745 mvchgat/\fBcurs_attr\fP(3X)
746 mvcur/\fBcurs_terminfo\fP(3X)
747 mvdelch/\fBcurs_delch\fP(3X)
748 mvderwin/\fBcurs_window\fP(3X)
749 mvget_wch/\fBcurs_get_wch\fP(3X)
750 mvget_wstr/\fBcurs_get_wstr\fP(3X)
751 mvgetch/\fBcurs_getch\fP(3X)
752 mvgetn_wstr/\fBcurs_get_wstr\fP(3X)
753 mvgetnstr/\fBcurs_getstr\fP(3X)
754 mvgetstr/\fBcurs_getstr\fP(3X)
755 mvhline/\fBcurs_border\fP(3X)
756 mvhline_set/\fBcurs_border_set\fP(3X)
757 mvin_wch/\fBcurs_in_wch\fP(3X)
758 mvin_wchnstr/\fBcurs_in_wchstr\fP(3X)
759 mvin_wchstr/\fBcurs_in_wchstr\fP(3X)
760 mvinch/\fBcurs_inch\fP(3X)
761 mvinchnstr/\fBcurs_inchstr\fP(3X)
762 mvinchstr/\fBcurs_inchstr\fP(3X)
763 mvinnstr/\fBcurs_instr\fP(3X)
764 mvinnwstr/\fBcurs_inwstr\fP(3X)
765 mvins_nwstr/\fBcurs_ins_wstr\fP(3X)
766 mvins_wch/\fBcurs_ins_wch\fP(3X)
767 mvins_wstr/\fBcurs_ins_wstr\fP(3X)
768 mvinsch/\fBcurs_insch\fP(3X)
769 mvinsnstr/\fBcurs_insstr\fP(3X)
770 mvinsstr/\fBcurs_insstr\fP(3X)
771 mvinstr/\fBcurs_instr\fP(3X)
772 mvinwstr/\fBcurs_inwstr\fP(3X)
773 mvprintw/\fBcurs_printw\fP(3X)
774 mvscanw/\fBcurs_scanw\fP(3X)
775 mvvline/\fBcurs_border\fP(3X)
776 mvvline_set/\fBcurs_border_set\fP(3X)
777 mvwadd_wch/\fBcurs_add_wch\fP(3X)
778 mvwadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
779 mvwadd_wchstr/\fBcurs_add_wchstr\fP(3X)
780 mvwaddch/\fBcurs_addch\fP(3X)
781 mvwaddchnstr/\fBcurs_addchstr\fP(3X)
782 mvwaddchstr/\fBcurs_addchstr\fP(3X)
783 mvwaddnstr/\fBcurs_addstr\fP(3X)
784 mvwaddnwstr/\fBcurs_addwstr\fP(3X)
785 mvwaddstr/\fBcurs_addstr\fP(3X)
786 mvwaddwstr/\fBcurs_addwstr\fP(3X)
787 mvwchgat/\fBcurs_attr\fP(3X)
788 mvwdelch/\fBcurs_delch\fP(3X)
789 mvwget_wch/\fBcurs_get_wch\fP(3X)
790 mvwget_wstr/\fBcurs_get_wstr\fP(3X)
791 mvwgetch/\fBcurs_getch\fP(3X)
792 mvwgetn_wstr/\fBcurs_get_wstr\fP(3X)
793 mvwgetnstr/\fBcurs_getstr\fP(3X)
794 mvwgetstr/\fBcurs_getstr\fP(3X)
795 mvwhline/\fBcurs_border\fP(3X)
796 mvwhline_set/\fBcurs_border_set\fP(3X)
797 mvwin/\fBcurs_window\fP(3X)
798 mvwin_wch/\fBcurs_in_wch\fP(3X)
799 mvwin_wchnstr/\fBcurs_in_wchstr\fP(3X)
800 mvwin_wchstr/\fBcurs_in_wchstr\fP(3X)
801 mvwinch/\fBcurs_inch\fP(3X)
802 mvwinchnstr/\fBcurs_inchstr\fP(3X)
803 mvwinchstr/\fBcurs_inchstr\fP(3X)
804 mvwinnstr/\fBcurs_instr\fP(3X)
805 mvwinnwstr/\fBcurs_inwstr\fP(3X)
806 mvwins_nwstr/\fBcurs_ins_wstr\fP(3X)
807 mvwins_wch/\fBcurs_ins_wch\fP(3X)
808 mvwins_wstr/\fBcurs_ins_wstr\fP(3X)
809 mvwinsch/\fBcurs_insch\fP(3X)
810 mvwinsnstr/\fBcurs_insstr\fP(3X)
811 mvwinsstr/\fBcurs_insstr\fP(3X)
812 mvwinstr/\fBcurs_instr\fP(3X)
813 mvwinwstr/\fBcurs_inwstr\fP(3X)
814 mvwprintw/\fBcurs_printw\fP(3X)
815 mvwscanw/\fBcurs_scanw\fP(3X)
816 mvwvline/\fBcurs_border\fP(3X)
817 mvwvline_set/\fBcurs_border_set\fP(3X)
818 napms/\fBcurs_kernel\fP(3X)
819 newpad/\fBcurs_pad\fP(3X)
820 newterm/\fBcurs_initscr\fP(3X)
821 newwin/\fBcurs_window\fP(3X)
822 nl/\fBcurs_inopts\fP(3X)
823 nocbreak/\fBcurs_inopts\fP(3X)
824 nodelay/\fBcurs_inopts\fP(3X)
825 noecho/\fBcurs_inopts\fP(3X)
826 nofilter/\fBcurs_util\fP(3X)*
827 nonl/\fBcurs_inopts\fP(3X)
828 noqiflush/\fBcurs_inopts\fP(3X)
829 noraw/\fBcurs_inopts\fP(3X)
830 notimeout/\fBcurs_inopts\fP(3X)
831 overlay/\fBcurs_overlay\fP(3X)
832 overwrite/\fBcurs_overlay\fP(3X)
833 pair_content/\fBcurs_color\fP(3X)
834 pecho_wchar/\fBcurs_pad\fP(3X)
835 pechochar/\fBcurs_pad\fP(3X)
836 pnoutrefresh/\fBcurs_pad\fP(3X)
837 prefresh/\fBcurs_pad\fP(3X)
838 printw/\fBcurs_printw\fP(3X)
839 putp/\fBcurs_terminfo\fP(3X)
840 putwin/\fBcurs_util\fP(3X)
841 qiflush/\fBcurs_inopts\fP(3X)
842 raw/\fBcurs_inopts\fP(3X)
843 redrawwin/\fBcurs_refresh\fP(3X)
844 refresh/\fBcurs_refresh\fP(3X)
845 reset_color_pairs/\fBcurs_color\fP(3X)*
846 reset_prog_mode/\fBcurs_kernel\fP(3X)
847 reset_shell_mode/\fBcurs_kernel\fP(3X)
848 resetty/\fBcurs_kernel\fP(3X)
849 resize_term/\fBresizeterm\fP(3X)*
850 resizeterm/\fBresizeterm\fP(3X)*
851 restartterm/\fBcurs_terminfo\fP(3X)
852 ripoffline/\fBcurs_kernel\fP(3X)
853 savetty/\fBcurs_kernel\fP(3X)
854 scanw/\fBcurs_scanw\fP(3X)
855 scr_dump/\fBcurs_scr_dump\fP(3X)
856 scr_init/\fBcurs_scr_dump\fP(3X)
857 scr_restore/\fBcurs_scr_dump\fP(3X)
858 scr_set/\fBcurs_scr_dump\fP(3X)
859 scrl/\fBcurs_scroll\fP(3X)
860 scroll/\fBcurs_scroll\fP(3X)
861 scrollok/\fBcurs_outopts\fP(3X)
862 set_curterm/\fBcurs_terminfo\fP(3X)
863 set_escdelay/\fBcurs_threads\fP(3X)*
864 set_tabsize/\fBcurs_threads\fP(3X)*
865 set_term/\fBcurs_initscr\fP(3X)
866 setcchar/\fBcurs_getcchar\fP(3X)
867 setscrreg/\fBcurs_outopts\fP(3X)
868 setsyx/\fBcurs_kernel\fP(3X)
869 setupterm/\fBcurs_terminfo\fP(3X)
870 slk_attr/\fBcurs_slk\fP(3X)*
871 slk_attr_off/\fBcurs_slk\fP(3X)
872 slk_attr_on/\fBcurs_slk\fP(3X)
873 slk_attr_set/\fBcurs_slk\fP(3X)
874 slk_attroff/\fBcurs_slk\fP(3X)
875 slk_attron/\fBcurs_slk\fP(3X)
876 slk_attrset/\fBcurs_slk\fP(3X)
877 slk_clear/\fBcurs_slk\fP(3X)
878 slk_color/\fBcurs_slk\fP(3X)
879 slk_init/\fBcurs_slk\fP(3X)
880 slk_label/\fBcurs_slk\fP(3X)
881 slk_noutrefresh/\fBcurs_slk\fP(3X)
882 slk_refresh/\fBcurs_slk\fP(3X)
883 slk_restore/\fBcurs_slk\fP(3X)
884 slk_set/\fBcurs_slk\fP(3X)
885 slk_touch/\fBcurs_slk\fP(3X)
886 slk_wset/\fBcurs_slk\fP(3X)
887 standend/\fBcurs_attr\fP(3X)
888 standout/\fBcurs_attr\fP(3X)
889 start_color/\fBcurs_color\fP(3X)
890 subpad/\fBcurs_pad\fP(3X)
891 subwin/\fBcurs_window\fP(3X)
892 syncok/\fBcurs_window\fP(3X)
893 term_attrs/\fBcurs_termattrs\fP(3X)
894 termattrs/\fBcurs_termattrs\fP(3X)
895 termname/\fBcurs_termattrs\fP(3X)
896 tgetent/\fBcurs_termcap\fP(3X)
897 tgetflag/\fBcurs_termcap\fP(3X)
898 tgetnum/\fBcurs_termcap\fP(3X)
899 tgetstr/\fBcurs_termcap\fP(3X)
900 tgoto/\fBcurs_termcap\fP(3X)
901 tigetflag/\fBcurs_terminfo\fP(3X)
902 tigetnum/\fBcurs_terminfo\fP(3X)
903 tigetstr/\fBcurs_terminfo\fP(3X)
904 timeout/\fBcurs_inopts\fP(3X)
905 tiparm/\fBcurs_terminfo\fP(3X)
906 tiparm_s/\fBcurs_terminfo\fP(3X)*
907 tiscan_s/\fBcurs_terminfo\fP(3X)*
908 touchline/\fBcurs_touch\fP(3X)
909 touchwin/\fBcurs_touch\fP(3X)
910 tparm/\fBcurs_terminfo\fP(3X)
911 tputs/\fBcurs_termcap\fP(3X)
912 tputs/\fBcurs_terminfo\fP(3X)
913 trace/\fBcurs_trace\fP(3X)*
914 typeahead/\fBcurs_inopts\fP(3X)
915 unctrl/\fBcurs_util\fP(3X)
916 unget_wch/\fBcurs_get_wch\fP(3X)
917 ungetch/\fBcurs_getch\fP(3X)
918 ungetmouse/\fBcurs_mouse\fP(3X)*
919 untouchwin/\fBcurs_touch\fP(3X)
920 use_default_colors/\fBdefault_colors\fP(3X)*
921 use_env/\fBcurs_util\fP(3X)
922 use_extended_names/\fBcurs_extend\fP(3X)*
923 use_legacy_coding/\fBlegacy_coding\fP(3X)*
924 use_screen/\fBcurs_threads\fP(3X)*
925 use_tioctl/\fBcurs_util\fP(3X)*
926 use_window/\fBcurs_threads\fP(3X)*
927 vid_attr/\fBcurs_terminfo\fP(3X)
928 vid_puts/\fBcurs_terminfo\fP(3X)
929 vidattr/\fBcurs_terminfo\fP(3X)
930 vidputs/\fBcurs_terminfo\fP(3X)
931 vline/\fBcurs_border\fP(3X)
932 vline_set/\fBcurs_border_set\fP(3X)
933 vw_printw/\fBcurs_printw\fP(3X)
934 vw_scanw/\fBcurs_scanw\fP(3X)
935 vwprintw/\fBcurs_printw\fP(3X)
936 vwscanw/\fBcurs_scanw\fP(3X)
937 wadd_wch/\fBcurs_add_wch\fP(3X)
938 wadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
939 wadd_wchstr/\fBcurs_add_wchstr\fP(3X)
940 waddch/\fBcurs_addch\fP(3X)
941 waddchnstr/\fBcurs_addchstr\fP(3X)
942 waddchstr/\fBcurs_addchstr\fP(3X)
943 waddnstr/\fBcurs_addstr\fP(3X)
944 waddnwstr/\fBcurs_addwstr\fP(3X)
945 waddstr/\fBcurs_addstr\fP(3X)
946 waddwstr/\fBcurs_addwstr\fP(3X)
947 wattr_get/\fBcurs_attr\fP(3X)
948 wattr_off/\fBcurs_attr\fP(3X)
949 wattr_on/\fBcurs_attr\fP(3X)
950 wattr_set/\fBcurs_attr\fP(3X)
951 wattroff/\fBcurs_attr\fP(3X)
952 wattron/\fBcurs_attr\fP(3X)
953 wattrset/\fBcurs_attr\fP(3X)
954 wbkgd/\fBcurs_bkgd\fP(3X)
955 wbkgdset/\fBcurs_bkgd\fP(3X)
956 wbkgrnd/\fBcurs_bkgrnd\fP(3X)
957 wbkgrndset/\fBcurs_bkgrnd\fP(3X)
958 wborder/\fBcurs_border\fP(3X)
959 wborder_set/\fBcurs_border_set\fP(3X)
960 wchgat/\fBcurs_attr\fP(3X)
961 wclear/\fBcurs_clear\fP(3X)
962 wclrtobot/\fBcurs_clear\fP(3X)
963 wclrtoeol/\fBcurs_clear\fP(3X)
964 wcolor_set/\fBcurs_attr\fP(3X)
965 wcursyncup/\fBcurs_window\fP(3X)
966 wdelch/\fBcurs_delch\fP(3X)
967 wdeleteln/\fBcurs_deleteln\fP(3X)
968 wecho_wchar/\fBcurs_add_wch\fP(3X)
969 wechochar/\fBcurs_addch\fP(3X)
970 wenclose/\fBcurs_mouse\fP(3X)*
971 werase/\fBcurs_clear\fP(3X)
972 wget_wch/\fBcurs_get_wch\fP(3X)
973 wget_wstr/\fBcurs_get_wstr\fP(3X)
974 wgetbkgrnd/\fBcurs_bkgrnd\fP(3X)
975 wgetch/\fBcurs_getch\fP(3X)
976 wgetdelay/\fBcurs_opaque\fP(3X)*
977 wgetn_wstr/\fBcurs_get_wstr\fP(3X)
978 wgetnstr/\fBcurs_getstr\fP(3X)
979 wgetparent/\fBcurs_opaque\fP(3X)*
980 wgetscrreg/\fBcurs_opaque\fP(3X)*
981 wgetstr/\fBcurs_getstr\fP(3X)
982 whline/\fBcurs_border\fP(3X)
983 whline_set/\fBcurs_border_set\fP(3X)
984 win_wch/\fBcurs_in_wch\fP(3X)
985 win_wchnstr/\fBcurs_in_wchstr\fP(3X)
986 win_wchstr/\fBcurs_in_wchstr\fP(3X)
987 winch/\fBcurs_inch\fP(3X)
988 winchnstr/\fBcurs_inchstr\fP(3X)
989 winchstr/\fBcurs_inchstr\fP(3X)
990 winnstr/\fBcurs_instr\fP(3X)
991 winnwstr/\fBcurs_inwstr\fP(3X)
992 wins_nwstr/\fBcurs_ins_wstr\fP(3X)
993 wins_wch/\fBcurs_ins_wch\fP(3X)
994 wins_wstr/\fBcurs_ins_wstr\fP(3X)
995 winsch/\fBcurs_insch\fP(3X)
996 winsdelln/\fBcurs_deleteln\fP(3X)
997 winsertln/\fBcurs_deleteln\fP(3X)
998 winsnstr/\fBcurs_insstr\fP(3X)
999 winsstr/\fBcurs_insstr\fP(3X)
1000 winstr/\fBcurs_instr\fP(3X)
1001 winwstr/\fBcurs_inwstr\fP(3X)
1002 wmouse_trafo/\fBcurs_mouse\fP(3X)*
1003 wmove/\fBcurs_move\fP(3X)
1004 wnoutrefresh/\fBcurs_refresh\fP(3X)
1005 wprintw/\fBcurs_printw\fP(3X)
1006 wredrawln/\fBcurs_refresh\fP(3X)
1007 wrefresh/\fBcurs_refresh\fP(3X)
1008 wresize/\fBwresize\fP(3X)*
1009 wscanw/\fBcurs_scanw\fP(3X)
1010 wscrl/\fBcurs_scroll\fP(3X)
1011 wsetscrreg/\fBcurs_outopts\fP(3X)
1012 wstandend/\fBcurs_attr\fP(3X)
1013 wstandout/\fBcurs_attr\fP(3X)
1014 wsyncdown/\fBcurs_window\fP(3X)
1015 wsyncup/\fBcurs_window\fP(3X)
1016 wtimeout/\fBcurs_inopts\fP(3X)
1017 wtouchln/\fBcurs_touch\fP(3X)
1018 wunctrl/\fBcurs_util\fP(3X)
1019 wvline/\fBcurs_border\fP(3X)
1020 wvline_set/\fBcurs_border_set\fP(3X)
1024 .I "screen-pointer extension"
1025 adds additional functions corresponding to many of the above,
1026 each with an \*(``_sp\*('' suffix;
1027 see \fBcurs_sp_funcs\fP(3X).
1029 The availability of some extensions is configurable when
1032 see sections \*(``ALTERNATE CONFIGURATIONS\*('' and \*(``EXTENSIONS\*(''
1035 Unless otherwise noted,
1036 functions that return an integer return
1041 Functions that return pointers return
1046 treats a null pointer passed as a function parameter as a failure.
1047 Functions prefixed with \*(``mv\*('' first perform cursor movement and
1048 fail if the position
1051 is outside the window boundaries.
1053 The following symbols from the process environment customize the
1057 The library may be configured to disregard the variables
1059 .IR \%TERMINFO_DIRS ,
1063 if the user is the superuser (root),
1064 or the application uses \fI\%setuid\fP(2) or \fI\%setgid\fP(2).
1065 .SS "\fIBAUDRATE\fP"
1066 The debugging library checks this variable when the application has
1067 redirected output to a file.
1068 Its integral value is used for the baud rate.
1069 If that value is absent or invalid,
1072 This feature allows testers to construct repeatable test cases
1073 that take into account optimization decisions that depend on baud rate.
1074 .SS "\fICC\fP (command character)"
1077 .B \%command_character
1079 capability value of loaded
1081 entries changes to the value of this variable.
1084 entries provide this feature.
1086 Because this name is also used in development environments to represent
1087 the C compiler's name,
1089 ignores its value if it is not one character in length.
1091 This variable specifies the width of the screen in characters.
1092 Applications running in a windowing environment usually are able to
1093 obtain the width of the window in which they are executing.
1096 is not defined and the terminal's screen size is not available from the
1099 uses the size specified by the
1102 capability of the terminal type's entry in the
1107 It is important that your application use the correct screen size.
1108 Automatic detection thereof is not always possible because an
1109 application may be running on a host that does not honor NAWS
1110 (Negotiations About Window Size)
1111 or as a different user ID than the owner of the terminal device file.
1116 overrides the library's use of the screen size obtained from the
1123 variables may be specified independently.
1124 This property is useful to circumvent misfeatures of legacy terminal
1126 \fI\%xterm\fP(1) descriptions specifying 65 lines were once notorious.
1134 descriptions of terminal emulators.
1136 \fBuse_env\fP(3X) can disable use of the process environment
1137 in determining the screen size.
1138 \fBuse_tioctl\fP(3X) can update
1142 to match the screen size obtained from system calls or the terminal
1144 .SS "\fIESCDELAY\fP"
1147 to distinguish the ESC character resulting from a user's press of the
1148 \*(``Escape\*('' key on the input device from one beginning an
1149 .I "escape sequence"
1150 (as commonly produced by function keys),
1151 it waits after receiving the escape character to see if further
1152 characters are available on the input stream within a short interval.
1155 stores this interval in milliseconds.
1156 The default value of 1000
1158 is adequate for most uses.
1159 This environment variable overrides it.
1161 The most common instance where you may wish to change this value
1162 is to work with a remote host over a slow communication channel.
1163 If the host running a
1165 application does not receive the characters of an escape sequence in a
1167 the library can interpret them as multiple key stroke events.
1169 \fI\%xterm\fP(1) mouse events are a form of escape sequence;
1171 if your application makes heavy use of multiple-clicking,
1172 you may wish to lengthen the default value because the delay applies
1173 to the composite multi-click event as well as the individual clicks.
1175 Portable applications should not rely upon the presence of
1178 but setting the environment variable rather than the global variable
1179 does not create problems when compiling an application.
1181 If \fB\%keypad\fP(3X) is disabled for the
1183 window receiving input,
1184 a program must disambiguate escape sequences itself.
1187 may read and write auxiliary terminal descriptions in
1191 files in the user's home directory.
1195 specifies the height of the screen in characters.
1198 capability and code is
1200 See the description of the
1203 .SS "\fIMOUSE_BUTTONS_123\fP"
1204 (OS/2 EMX port only)
1205 OS/2 numbers a three-button mouse inconsistently with other platforms,
1206 such that 1 is the left button,
1209 This variable customizes the mouse button numbering.
1210 Its value must be three digits 1\-3 in any order.
1213 assumes a numbering of \*(``132\*(''.
1214 .SS "\fINCURSES_ASSUMED_COLORS\fP"
1216 this variable overrides the
1218 library's compiled-in assumption that the terminal's default colors are
1220 see \fB\%default_colors\fP(3X).
1221 Set the foreground and background color values with this environment
1222 variable by assigning it two integer values separated by a comma,
1223 indicating foregound and background color numbers,
1229 not to assume anything about the colors,
1230 use a value of \*(``\-1,\-1\*(''.
1231 To make the default color scheme green on black,
1234 accepts integral values from \-1 up to the value of the
1239 .SS "\fINCURSES_CONSOLE2\fP"
1243 .\" https://www.hanselman.com/blog/console2-a-better-windows-command-prompt
1244 program defectively handles the Microsoft Console API call
1245 .IR \%Create\%Console\%Screen\%Buffer .
1246 Applications that use it will hang.
1248 it is possible to simulate the action of this call by mapping
1250 explicitly saving and restoring the original screen contents.
1251 Setting the environment variable
1253 has the same effect.
1254 .SS "\fINCURSES_GPM_TERMS\fP"
1258 is configured to use the GPM interface,
1259 this variable may list one or more terminal names
1265 An empty value disables the GPM interface,
1268 built-in support for \fIxterm\fP(1) mouse protocols instead.
1269 If the variable is absent,
1271 attempts to open GPM if
1273 contains \*(``linux\*(''.
1274 .SS "\fINCURSES_NO_HARD_TABS\fP"
1276 may use tab characters in cursor movement optimization.
1278 your terminal driver may not handle them properly.
1279 Set this environment variable to any value to disable the feature.
1280 You can also adjust your \fI\%stty\fP(1) settings to avoid the problem.
1281 .SS "\fINCURSES_NO_MAGIC_COOKIE\fP"
1282 Many terminals store video attributes as a property of a character cell,
1287 some recorded changes in video attributes as data that logically
1289 character cells on the display,
1290 switching attributes on or off,
1291 similarly to tags in a markup language;
1292 these are termed \*(``magic cookies\*('',
1293 and must be subsequently overprinted.
1296 entry for your terminal type does not adequately describe its handling
1298 set this variable to any value to instruct
1300 to disable attributes entirely.
1301 .SS "\fINCURSES_NO_PADDING\fP"
1302 Most terminal type descriptions in the
1304 database detail hardware devices.
1307 applications in terminal emulator programs that run in a windowing
1309 These programs can duplicate all of the important features of a hardware
1311 but often lack their limitations.
1312 Chief among these absent drawbacks is the problem of data flow
1315 limiting the speed of communication to what the hardware could handle.
1316 Unless a hardware terminal is interfaced into a terminal concentrator
1317 (which does flow control),
1318 an application must manage flow control itself to prevent overruns and
1321 A solution that comes at no hardware cost is for an application to pause
1322 after directing a terminal to execute an operation that it performs
1324 such as clearing the display.
1325 Many terminal type descriptions,
1326 including that for the VT100,
1327 embed delay specifications in capabilities.
1328 You may wish to use these temrinal descriptions without paying the
1329 performance penalty.
1331 .I \%NCURSES_NO_PADDING
1332 to any value to disable all but mandatory padding.
1333 Mandatory padding is used by such terminal capabilities as
1336 .SS "\fINCURSES_NO_SETBUF\fP"
1338 Prior to internal changes developed in
1341 (patches 20120825 through 20130126),
1342 the library used \fI\%setbuf\fP(3) to enable fully buffered output when
1343 initializing the terminal.
1347 to increase performance.
1348 For testing purposes,
1351 and of certain applications,
1352 this feature was made optional.
1353 Setting this variable disabled output buffering,
1354 leaving the output stream in the original
1355 (usually line-buffered)
1360 performs its own buffering and does not require this workaround;
1361 it does not modify the buffering of the standard output stream.
1362 This approach makes signal handling,
1365 A drawback is that certain unconventional programs mixed
1366 \fI\%stdio\fP(3) calls with
1369 got the behavior they expected.
1370 This is no longer the case;
1372 does not write to the standard output file descriptor through a
1377 low-level API calls such as \fB\%putp\fP(3X) still use the
1378 standard output stream.
1381 calls such as \fB\%printw\fP(3X) do not.
1382 .SS "\fINCURSES_NO_UTF8_ACS\fP"
1387 environment variable for special cases where VT100 forms-drawing
1389 (and the corresponding alternate character set
1392 are known to be unsupported by terminal types that otherwise claim VT100
1395 when running in a UTF-8 locale,
1396 the Linux virtual console device and the GNU \fI\%screen\fP(1)
1397 program ignore them.
1398 Set this variable to a nonzero value to instruct
1400 that the terminal's ACS support is broken;
1401 the library then outputs Unicode code points that correspond to the
1406 to disable the special check for terminal type names matching
1407 \*(``linux\*('' or \*(``screen\*('',
1410 to assume that the ACS feature works if the terminal type description
1413 As an alternative to use of this variable,
1415 checks for an extended
1417 numeric capability \fBU8\fP
1418 that can be compiled using
1419 .RB \*(`` "@TIC@ \-x" \*(''.
1424 # linux console, if patched to provide working
1425 # VT100 shift\-in/shift\-out, with corresponding font.
1426 linux\-vt100|linux console with VT100 line\-graphics,
1429 # uxterm with vt100Graphics resource set to false
1430 xterm\-utf8|xterm relying on UTF\-8 line\-graphics,
1435 The two-character name \*(``U8\*('' was chosen to permit its use via
1439 .SS "\fINCURSES_TRACE\fP"
1442 (in its debugging configuration)
1443 checks for this variable's presence.
1444 If defined with an integral value,
1445 the library calls \fB\%curses_trace\fP(3X) with that value as the
1450 variable denotes the terminal type.
1452 though many are similar.
1453 It is commonly set by terminal emulators to help applications find a
1454 workable terminal description.
1455 Some choose a popular approximation such as \*(``ansi\*('',
1456 \*(``vt100\*('', or \*(``xterm\*('' rather than an exact fit to their
1459 an application will have problems with that approach;
1461 a key stroke may not operate correctly,
1462 or produce no effect but seeming garbage characters on the screen.
1466 has no effect on hardware operation;
1467 it affects the way applications communicate with the terminal.
1470 (\fIxterm\fP(1) being a rare exception),
1471 terminal emulators that allow you to specify
1473 as a parameter or configuration value do not change their behavior to
1481 it checks for a terminal type description in
1485 format is not available.
1486 Setting this variable directs
1491 .IR \%/etc/termcap ;
1496 should contain either a terminal description
1497 (with newlines stripped out),
1498 or a file name indicating where the information required by the
1500 environment variable is stored.
1501 .SS "\fITERMINFO\fP"
1503 can be configured to read terminal type description databases in various
1504 locations using different formats.
1505 This variable overrides the default location.
1509 format are normally stored in a directory tree using subdirectories
1510 named by the common first letters of the terminal types named therein.
1511 This is the scheme used in System\ V.
1515 is configured to use hashed databases,
1518 may name its location,
1520 .IR \%/usr/share/terminfo.db ,
1522 .IR \%/usr/share/terminfo/ .
1524 The hashed database uses less disk space and is a little faster than the
1527 some applications assume the existence of the directory tree,
1528 and read it directly
1529 rather than using the
1538 this variable may contain the location of a
1544 begins with \*(``hex:\*('' or \*(``b64:\*('',
1546 uses the remainder of the value as a compiled
1549 You might produce the base64 format using \fB\%infocmp\fP(1M).
1553 TERMINFO=$(infocmp \-0 \-Q2 \-q)
1558 The compiled description is used only if it corresponds to the terminal
1568 to a terminal database.
1569 The search path is as follows.
1571 the last terminal database to which the running
1576 the location specified by the
1578 environment variable
1582 locations listed in the
1584 environment variable
1586 .if !'@TERMINFO_DIRS@'no default value' .as td @TERMINFO_DIRS@
1587 .if !'@TERMINFO@\*(td'' \{\
1589 location(s) configured and compiled into
1594 .I \%@TERMINFO_DIRS@
1596 .if !'@TERMINFO'' .if !'\*(td'@TERMINFO@' \{\
1602 .SS "\fITERMINFO_DIRS\fP"
1603 This variable specifies a list of locations,
1608 searches for the terminal type descriptions described by
1611 The list items are separated by colons on Unix
1612 and semicolons on OS/2 EMX.
1615 lacks a corresponding feature;
1620 .SS "\fITERMPATH\fP"
1623 does not hold a terminal type description or file name,
1626 checks the contents of
1628 a list of locations,
1631 in which it searches for
1633 terminal type descriptions.
1634 The list items are separated by colons on Unix
1635 and semicolons on OS/2 EMX.
1641 are unset or invalid,
1643 searches for the files
1644 .IR \%/etc/termcap ,
1645 .IR \%/usr/share/misc/termcap ,
1647 .IR \%$HOME/.termcap ,
1649 .SH "ALTERNATE CONFIGURATIONS"
1652 configurations are possible,
1653 determined by the options given to the
1655 script when building the library.
1656 Run the script with the
1658 option to peruse them all.
1659 A few are of particular significance to the application developer
1663 .B \-\-disable\-overwrite
1664 The standard include for \fI\%ncurses\fP is as noted in \fBSYNOPSIS\fP:
1669 \fB#include <curses.h>\fP
1673 This option is used to avoid filename conflicts when \fI\%ncurses\fP
1674 is not the main implementation of curses of the computer.
1675 If \fI\%ncurses\fP is installed disabling overwrite,
1676 it puts its headers in a subdirectory,
1681 \fB#include <ncurses/curses.h>\fP
1685 It also omits a symbolic link which would allow you to use \fB\-lcurses\fP
1686 to build executables.
1689 .B \-\-enable\-widec
1690 The configure script renames the library and
1691 (if the \fB\-\-disable\-overwrite\fP option is used)
1692 puts the header files in a different subdirectory.
1693 All of the library names have a \*(``w\*('' appended to them,
1711 You must also enable the wide-character features in the header file
1712 when compiling for the wide-character library
1713 to use the extended (wide-character) functions.
1714 The symbol which enables these features has changed
1715 since X/Open Curses, Issue 4:
1717 Originally, the wide-character feature required the symbol
1718 \fB_XOPEN_SOURCE_EXTENDED\fP
1719 but that was only valid for XPG4 (1996).
1721 Later, that was deemed conflicting with \fB_XOPEN_SOURCE\fP defined to 500.
1724 none of the features in this implementation require a \fB_XOPEN_SOURCE\fP
1725 feature greater than 600.
1726 However, X/Open Curses, Issue 7 (2009) recommends defining it to 700.
1728 Alternatively, you can enable the feature by defining \fBNCURSES_WIDECHAR\fP
1729 with the caveat that some other header file than \fBcurses.h\fP
1730 may require a specific value for \fB_XOPEN_SOURCE\fP
1731 (or a system-specific symbol).
1733 The \fI\%curses.h\fP header file installed for the wide-character
1734 library is designed to be compatible with the non-wide library's header.
1735 Only the size of the \fI\%WINDOW\fP structure differs;
1736 few applications require more than pointers to \fI\%WINDOW\fPs.
1738 If the headers are installed allowing overwrite,
1739 the wide-character library's headers should be installed last,
1740 to allow applications to be built using either library
1741 from the same set of headers.
1744 .B \-\-with\-pthread
1745 The configure script renames the library.
1746 All of the library names have a \*(``t\*('' appended to them
1747 (before any \*(``w\*('' added by \fB\-\-enable\-widec\fP).
1749 The global variables such as \fBLINES\fP are replaced by macros to
1750 allow read-only access.
1751 At the same time, setter-functions are provided to set these values.
1752 Some applications (very few) may require changes to work with this convention.
1760 .B \-\-with\-profile
1761 The shared and normal (static) library names differ by their suffixes,
1762 e.g., \fBlibncurses.so\fP and \fBlibncurses.a\fP.
1763 The debug and profiling libraries add a \*(``_g\*(''
1764 and a \*(``_p\*('' to the root names respectively,
1765 e.g., \fBlibncurses_g.a\fP and \fBlibncurses_p.a\fP.
1767 .B \-\-with\-termlib
1768 Low-level functions which do not depend upon whether the library
1769 supports wide-characters, are provided in the tinfo library.
1771 By doing this, it is possible to share the tinfo library between
1772 wide/normal configurations as well as reduce the size of the library
1773 when only low-level functions are needed.
1775 Those functions are described in these pages:
1778 \fB\%curs_extend\fP(3X) \- miscellaneous \fIcurses\fP extensions
1780 \fB\%curs_inopts\fP(3X) \- \fIcurses\fP input options
1782 \fB\%curs_kernel\fP(3X) \- low-level \fIcurses\fP routines
1784 \fB\%curs_termattrs\fP(3X) \- \fIcurses\fP environment query routines
1786 \fB\%curs_termcap\fP(3X) \- \fIcurses\fP emulation of \fItermcap\fP
1788 \fB\%curs_terminfo\fP(3X) \- \fIcurses\fP interface to \fIterminfo\fP
1791 \fB\%curs_util\fP(3X) \- miscellaneous \fIcurses\fP utility routines
1795 The \fBtrace\fP function normally resides in the debug library,
1796 but it is sometimes useful to configure this in the shared library.
1797 Configure scripts should check for the function's existence rather
1798 than assuming it is always in the debug library.
1802 tab stop initialization database
1805 compiled terminal capability database
1807 X/Open Curses permits most functions it specifies to be made available
1809 .\" See X/Open Curses Issue 4, Version 2, pp. 227-234.
1810 .\" See X/Open Curses Issue 7, pp. 311-318.
1811 \fI\%ncurses\fP does so
1813 for functions that return values via their parameters,
1815 to support obsolete features,
1819 those that move the cursor before another operation),
1822 a few special cases.
1824 If the standard output file descriptor of an
1826 program is redirected to something that is not a terminal device,
1827 the library writes screen updates to the standard error file descriptor.
1828 This was an undocumented feature of SVr3
1831 See subsection \*(``Header Files\*('' below regarding symbols exposed by
1832 inclusion of \fI\%curses.h\fP.
1835 enables an application to capture mouse events on certain terminals,
1836 including \fI\%xterm\fP(1);
1837 see \fB\%curs_mouse\fP(3X).
1840 provides a means of responding to window resizing events,
1841 as when running in a GUI terminal emulator application such as
1843 see \fB\%resizeterm\fP(3X) and \fB\%wresize\fP(3X).
1846 allows an application to query the terminal for the presence of a wide
1847 variety of special keys;
1848 see \fB\%has_key\fP(3X).
1851 extends the fixed set of function key capabilities specified by X/Open
1852 Curses by allowing the application programmer to define additional key
1855 \fB\%define_key\fP(3X),
1856 \fB\%key_defined\fP(3X),
1857 \fB\%keybound\fP(3X),
1862 can exploit the capabilities of terminals implementing ISO\ 6429/ECMA-48
1863 SGR\ 39 and SGR\ 49 sequences,
1864 which allow an application to reset the terminal to its original
1865 foreground and background colors.
1866 From a user's perspective,
1867 the application is able to draw colored text on a background whose color
1868 is set independently,
1869 providing better control over color contrasts.
1870 See \fB\%default_colors\fP(3X).
1874 application can eschew knowledge of
1876 structure internals,
1877 instead using accessor functions such as
1878 \fB\%is_scrollok\fP(3X).
1881 enables an application to direct application output to a printer
1882 attached to the terminal device;
1883 see \fB\%curs_print\fP(3X).
1886 offers \fB\%slk_attr\fP(3X) as a counterpart of \fB\%attr_get\fP(3X) for
1887 soft-label key lines,
1888 and \fB\%extended_slk_color\fP(3X) as a form of \fB\%slk_color\fP(3X)
1889 that can gather color information from them when many colors are
1892 Some extensions are available only if
1894 permits modification of \fB\%unctrl\fP(3X)'s behavior;
1895 see \fB\%use_legacy_coding\fP(3X).
1897 is compiled to support them;
1898 section \*(``ALTERNATE CONFIGURATIONS\*('' describes how.
1900 Rudimentary support for multi-threaded applications may be available;
1901 see \fBcurs_threads\fP(3X).
1903 Functions that ease the management of multiple screens can be exposed;
1904 see \fBcurs_sp_funcs\fP(3X).
1906 To aid applications to debug their memory usage,
1908 optionally offers functions to more aggressively free memory it
1909 dynamically allocates itself;
1910 see \fBcurs_memleaks\fP(3X).
1912 The library facilitates auditing and troubleshooting of its behavior;
1913 see \fBcurs_trace\fP(3X).
1917 causes the library to fall back to reading
1919 if the terminal setup code cannot find a
1921 entry corresponding to
1923 Use of this feature is not recommended,
1924 as it essentially includes an entire
1929 at a cost in memory usage and application launch latency.
1937 Individual man pages indicate where this is the case.
1939 X/Open Curses defines two levels of conformance,
1940 \*(``base\*('' and \*(``enhanced\*(''.
1941 The latter includes several additional features,
1942 such as wide-character and color support.
1944 intends base-level conformance with X/Open Curses,
1945 and supports nearly all features of its enhanced level.
1946 .\" XXX: What's missing? GBR counts untic(1), and that's all.
1948 Differences between X/Open Curses and
1950 are documented in the \*(``PORTABILITY\*('' sections of applicable man
1952 .SS "Error Checking"
1953 In many cases, X/Open Curses is vague about error conditions,
1954 omitting some of the SVr4 documentation.
1956 Unlike other implementations,
1958 checks pointer parameters,
1962 to ensure that they are not null.
1963 This is done primarily to guard against programmer error.
1964 The standard interface does not provide a way for the library
1965 to tell an application which of several possible errors occurred.
1968 extension adversely affects the portability of
1971 .SS "Padding Differences"
1975 delays embedded in the
1978 .B \%carriage_return
1989 activated corresponding delay bits in the Unix terminal driver.
1991 performs all padding by sending NUL bytes to the device.
1992 This method is slightly more expensive,
1993 but narrows the interface to the Unix kernel significantly and
1994 correspondingly increases the package's portability.
1998 itself includes the header files
2003 X/Open Curses has more to say,
2008 may make visible all symbols from the headers
2016 but does not finish the story.
2017 A more complete account follows.
2022 all implementations have provided a
2032 from an internal header file
2035 \*(``ext\*('' abbreviated \*(``externs\*(''.
2037 The implementations of
2041 used undocumented internal functions of the standard I/O library
2056 because its function prototype employs the
2069 X/Open Curses specifies all three of these functions.
2073 and X/Open Curses do not require the developer to include
2077 Both document use of
2088 X/Open Curses and SVr4
2090 are inconsistent with respect to
2093 As noted in \fBcurs_util\fP(3X),
2101 X/Open Curses's comments about
2105 may refer to HP-UX and AIX.
2135 X/Open Curses says that
2140 but does not require it to do so.
2142 Some programs use functions declared in both
2146 and must include both header files in the same module.
2147 Very old versions of AIX
2149 required inclusion of
2154 The header files supplied by
2156 include the standard library headers required for its declarations,
2159 own header files can be included in any order.
2160 But for portability,
2166 X/Open Curses says \*(``may make visible\*('' because including a header
2167 file does not necessarily make visible all of the symbols in it
2175 .B may \" bold to contrast with preceding italic
2178 if the proper symbol is defined,
2181 is configured for wide-character support.
2186 .B may \" bold for consistency in this paragraph
2187 be made visible depending on the value of the
2191 X/Open Curses mandates an application's inclusion of one standard C
2192 library header in a special case:
2196 to prototype the functions
2200 (as well as the obsolete
2204 Each of these takes a variadic argument list,
2208 like that of \fI\%printf\fP(3).
2213 the two obsolete functions,
2214 and X/Open Curses the others.
2218 provided for the possibility that an application might include either
2222 These represented contrasting approaches to handling variadic
2224 The older interface,
2227 .I char \" V7, 32V, System III, 3BSD
2228 for variadic functions'
2232 the list acquired its own standard data type,
2236 empowering the compiler to check the types of a function call's actual
2237 parameters against the formal ones declared in its prototype.
2239 No conforming implementations of X/Open Curses require an application
2244 because they either have allowed for a special type,
2250 themselves to provide a portable interface.
2259 \fB\%curs_variables\fP(3X),
2260 \fB\%terminfo\fP(5),
2261 \fB\%user_caps\fP(5)