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.207 2024/04/14 00:34:00 tom Exp $
32 .TH ncurses 3X 2024-04-13 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
52 character-cell terminal interface with optimized output
55 \fB#include <curses.h>
58 The \*(``new curses\*('' library offers the programmer a
59 terminal-independent means of reading keyboard and mouse input and
60 updating character-cell terminals with output optimized to minimize
66 System V Release 4 Unix (\*(``SVr4\*('')
69 the development of which ceased in the 1990s.
70 This describes \fI\%ncurses\fP
71 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
74 permits control of the terminal screen's contents;
75 abstraction and subdivision thereof with
79 the reading of terminal input;
80 control of terminal input and output options;
81 environment query routines;
83 the definition and use of
90 compatibility interface;
91 and an abstraction of the system's API for manipulating the terminal
92 (such as \fI\%termios\fP(3)).
95 implements the standard interface described by
96 X/Open Curses Issue\ 7.
97 In many behavioral details not standardized by X/Open,
101 library of SVr4 and provides numerous useful extensions.
104 man pages employ several sections to clarify matters of usage and
105 interoperability with other
109 \*(``NOTES\*('' describes issues and caveats of which any user of the
112 such as limitations on the size of an underlying integral type or the
113 availability of a preprocessor macro exclusive of a function definition
114 (which prevents its address from being taken).
115 This section also describes implementation details that will be
116 significant to the programmer but which are not standardized.
118 \*(``EXTENSIONS\*('' presents
120 innovations beyond the X/Open Curses standard and/or the SVr4
125 to indicate that they cannot be implemented solely by using the library
127 but require access to the library's internal state.
129 \*(``PORTABILITY\*('' discusses matters
130 (beyond the exercise of extensions)
131 that should be considered when writing to a
134 or for multiple implementations.
136 \*(``HISTORY\*('' examines points of detail in
140 implementations over the decades of their development,
141 particularly where precedent or inertia have frustrated better design
144 where such inertia has been overcome).
148 application must be linked with the library;
151 option to your compiler or linker.
152 A debugging version of the library may be available;
156 (Your system integrator may have installed these libraries such that you
164 library generates trace logs
167 in the current directory)
171 See section \*(``ALTERNATE CONFIGURATIONS\*('' below.
172 .SS "Application Structure"
175 application uses information from the system locale;
176 \fI\%setlocale\fP(3) prepares it for
182 setlocale(LC_ALL, "");
186 If the locale is not thus initialized,
187 the library assumes that characters are printable as in ISO\ 8859-1,
188 to work with certain legacy programs.
189 You should initialize the locale;
190 do not expect consistent behavior from the library when the locale has
193 \fB\%initscr\fP(3X) or \fB\%newterm\fP(3X)
194 must be called to initialize
196 before use of any functions that deal with windows and screens.
198 To get character-at-a-time input without echoing\(emmost interactive,
199 screen-oriented programs want this\(emuse the following sequence.
203 initscr(); cbreak(); noecho();
207 Most applications perform further setup as follows.
211 intrflush(stdscr, FALSE);
212 keypad(stdscr, TRUE);
218 program then often enters an event loop of some sort.
219 Call \fB\%endwin\fP(3X) before exiting.
223 library abstracts the terminal screen by representing all or part of it
229 is a rectangular grid of character cells,
230 addressed by row and column coordinates
233 with the upper left corner as (0, 0).
236 the same size as the terminal screen,
238 Create others with \fB\%newwin\fP(3X).
242 library does not manage overlapping windows
246 to manage one screen-filling window,
247 or tile the screen into non-overlapping windows and not use
250 Mixing the two approaches will result in unpredictable and undesired
253 Functions permit manipulation of a window and the
255 identifying the cell within it at which the next output operation will
258 the most basic are \fB\%move\fP(3X) and \fB\%addch\fP(3X):
259 these place the cursor and write a character to
263 Frequent changes to the terminal screen can cause unpleasant flicker or
264 inefficient use of the communication channel to the device,
265 so the library does not generally update it automatically.
269 functions to accumulate a set of desired updates that make sense to
271 call \fB\%refresh\fP(3X) to tell the library to make the user's screen
272 look like \fBstdscr\fP.
274 .\" X/Open Curses Issue 7 assumes some optimization will be done, but
275 .\" does not mandate it in any way.
277 its output by computing a minimal number of operations to mutate the
278 screen from its state at the previous refresh to the new one.
279 Effective optimization demands accurate information about the terminal
281 the management of such information is the province of the
282 \fB\%terminfo\fP(3X) API,
283 a feature of every standard
287 Special windows called
289 may also be manipulated.
290 These are windows that are not constrained to the size of the terminal
291 screen and whose contents need not be completely displayed.
292 See \fB\%curs_pad\fP(3X).
294 In addition to drawing characters on the screen,
295 rendering attributes and colors may be supported,
296 causing the characters to show up in such modes as underlined,
298 or in color on terminals that support such display enhancements.
299 See \fB\%curs_attr\fP(3X).
302 predefines constants for a small set of forms-drawing graphics
303 corresponding to the DEC Alternate Character Set (ACS),
304 a feature of VT100 and other terminals.
305 See \fB\%waddch\fP(3X).
308 is implemented using the operating system's terminal driver;
309 keystroke events are received not as scan codes but as byte sequences.
311 (alphanumeric and punctuation keys,
320 appears as a control character or a multibyte
321 .I "escape sequence."
323 translates these into unique
325 See \fB\%getch\fP(3X).
328 provides reimplementations of the SVr4 \fBpanel\fP(3X), \fBform\fP(3X),
329 and \fBmenu\fP(3X) libraries to ease construction of user interfaces
333 The selection of an appropriate value of
335 in the process environment is essential to correct
340 A well-configured system selects a correct
343 \fB\%tset\fP(1) may assist with troubleshooting exotic situations.
345 If you change the terminal type,
348 environment variable in the shell,
349 then run \fB\%tset\fP(1) or the
350 .RB \*(`` "@TPUT@ init" \*(''
352 See subsection \*(``Tabs and Initialization\*('' of \fB\%terminfo\fP(5).
354 If the environment variables
361 program is executing in a graphical windowing environment,
362 the information obtained thence overrides that obtained by
366 extension supports resizable terminals;
367 see \fB\%wresize\fP(3X).
369 If the environment variable
374 program checks first for a terminal type description in the location it
377 is useful for developing experimental type descriptions or when write
382 See section \*(``ENVIRONMENT\*('' below.
383 .SS "Naming Conventions"
385 offers many functions in variant forms using a regular set of
386 alternatives to the name of an elemental one.
387 Those prefixed with \*(``w\*('' require a
390 those with a \*(``mv\*('' prefix first perform cursor movement using
392 a \*(``mvw\*('' prefix indicates both.
393 The \*(``w\*('' function is typically the elemental one;
394 the removal of this prefix usually indicates operation on
397 Four functions prefixed with \*(``p\*('' require a pad argument.
399 In function synopses,
401 man pages apply the following names to parameters.
406 bf \fIbool\fP (\fBTRUE\fP or \fBFALSE\fP)
407 win pointer to a \fIWINDOW\fP
408 pad pointer to a \fIWINDOW\fP that is a pad
410 .SS "Wide and Non-wide Character Configurations"
411 This manual page describes functions that appear in any configuration
413 There are two common configurations;
414 see section \*(``ALTERNATE CONFIGURATIONS\*('' below.
415 .TP 10 \" "ncursesw" + 2n
417 is the library in its \*(``non-wide\*('' configuration,
418 handling only eight-bit characters.
419 It stores a character combined with attributes in a
422 which is often an alias of
426 (with no corresponding character)
427 can be stored in variables of
433 they are represented as an integral bit mask.
441 is the library in its \*(``wide\*('' configuration,
442 which handles character encodings requiring a larger data type than
446 It adds about one third more calls using additional data types that
450 .RS 10 \" same as foregoing tag width
451 .TP 9 \" "cchar_t" + 2n
453 corresponds to the non-wide configuration's
455 It always a structure type,
456 because it stores more data than fit into a standard scalar type.
457 A character code may not be representable as a
459 and moreover more than one character may occupy a cell
460 (as with accent marks and other diacritics).
461 Each character is of type
463 a complex character contains one spacing character and zero or more
464 non-spacing characters
466 Attributes and color data are stored in separate fields of the
476 \fB\%setcchar\fP(3X) and \fB\%getcchar\fP(3X)
480 The wide library API of
482 depends on two data types standardized by ISO C95.
485 stores a wide character.
488 it may be an alias of
490 Depending on the character encoding,
491 a wide character may be
493 meaning that it occupies a character cell by itself and typically
494 accompanies cursor advancement,
497 meaning that it occupies the same cell as a spacing character,
498 is often regarded as a \*(``modifier\*('' of the base glyph with which
500 and typically does not advance the cursor.
509 character manipulation functions of ISO C and its constant
513 The wide library provides additional functions that complement those in
514 the non-wide library where the size of the underlying character type is
516 A somewhat regular naming convention relates many of the wide variants
517 to their non-wide counterparts;
518 where a non-wide function name contains \*(``ch\*('' or \*(``str\*('',
519 prefix it with \*(``_w\*('' to obtain the wide counterpart.
521 \fB\%waddch\fP becomes \fB\%wadd_wch\fP.
522 (Exceptions that add only \*(``w\*('' comprise
527 This convention is inapplicable to some non-wide function names,
528 so other transformations are used for the wide configuration:
529 the window background management function \*(``bkgd\*('' becomes
531 the window border-drawing and -clearing functions are suffixed with
533 and character attribute manipulation functions like
534 \*(``attron\*('' become \*(``attr_on\*(''.
536 .SS "Function Name Index"
537 The following table lists the
539 functions provided in the non-wide and wide APIs and the corresponding
540 man pages that describe them.
541 Those flagged with \*(``*\*(''
543 .IR \%ncurses "-specific,"
544 neither described by X/Open Curses nor present in SVr4.
549 \f(BIcurses\fP Function Name/Man Page
551 COLOR_PAIR/\fBcurs_color\fP(3X)
552 PAIR_NUMBER/\fBcurs_color\fP(3X)
553 add_wch/\fBcurs_add_wch\fP(3X)
554 add_wchnstr/\fBcurs_add_wchstr\fP(3X)
555 add_wchstr/\fBcurs_add_wchstr\fP(3X)
556 addch/\fBcurs_addch\fP(3X)
557 addchnstr/\fBcurs_addchstr\fP(3X)
558 addchstr/\fBcurs_addchstr\fP(3X)
559 addnstr/\fBcurs_addstr\fP(3X)
560 addnwstr/\fBcurs_addwstr\fP(3X)
561 addstr/\fBcurs_addstr\fP(3X)
562 addwstr/\fBcurs_addwstr\fP(3X)
563 alloc_pair/\fBnew_pair\fP(3X)*
564 assume_default_colors/\fBdefault_colors\fP(3X)*
565 attr_get/\fBcurs_attr\fP(3X)
566 attr_off/\fBcurs_attr\fP(3X)
567 attr_on/\fBcurs_attr\fP(3X)
568 attr_set/\fBcurs_attr\fP(3X)
569 attroff/\fBcurs_attr\fP(3X)
570 attron/\fBcurs_attr\fP(3X)
571 attrset/\fBcurs_attr\fP(3X)
572 baudrate/\fBcurs_termattrs\fP(3X)
573 beep/\fBcurs_beep\fP(3X)
574 bkgd/\fBcurs_bkgd\fP(3X)
575 bkgdset/\fBcurs_bkgd\fP(3X)
576 bkgrnd/\fBcurs_bkgrnd\fP(3X)
577 bkgrndset/\fBcurs_bkgrnd\fP(3X)
578 border/\fBcurs_border\fP(3X)
579 border_set/\fBcurs_border_set\fP(3X)
580 box/\fBcurs_border\fP(3X)
581 box_set/\fBcurs_border_set\fP(3X)
582 can_change_color/\fBcurs_color\fP(3X)
583 cbreak/\fBcurs_inopts\fP(3X)
584 chgat/\fBcurs_attr\fP(3X)
585 clear/\fBcurs_clear\fP(3X)
586 clearok/\fBcurs_outopts\fP(3X)
587 clrtobot/\fBcurs_clear\fP(3X)
588 clrtoeol/\fBcurs_clear\fP(3X)
589 color_content/\fBcurs_color\fP(3X)
590 color_set/\fBcurs_attr\fP(3X)
591 copywin/\fBcurs_overlay\fP(3X)
592 curs_set/\fBcurs_kernel\fP(3X)
593 curses_trace/\fBcurs_trace\fP(3X)*
594 curses_version/\fBcurs_extend\fP(3X)*
595 def_prog_mode/\fBcurs_kernel\fP(3X)
596 def_shell_mode/\fBcurs_kernel\fP(3X)
597 define_key/\fBdefine_key\fP(3X)*
598 del_curterm/\fBcurs_terminfo\fP(3X)
599 delay_output/\fBcurs_util\fP(3X)
600 delch/\fBcurs_delch\fP(3X)
601 deleteln/\fBcurs_deleteln\fP(3X)
602 delscreen/\fBcurs_initscr\fP(3X)
603 delwin/\fBcurs_window\fP(3X)
604 derwin/\fBcurs_window\fP(3X)
605 doupdate/\fBcurs_refresh\fP(3X)
606 dupwin/\fBcurs_window\fP(3X)
607 echo/\fBcurs_inopts\fP(3X)
608 echo_wchar/\fBcurs_add_wch\fP(3X)
609 echochar/\fBcurs_addch\fP(3X)
610 endwin/\fBcurs_initscr\fP(3X)
611 erase/\fBcurs_clear\fP(3X)
612 erasechar/\fBcurs_termattrs\fP(3X)
613 erasewchar/\fBcurs_termattrs\fP(3X)
614 exit_curses/\fBcurs_memleaks\fP(3X)*
615 exit_terminfo/\fBcurs_memleaks\fP(3X)*
616 extended_color_content/\fBcurs_color\fP(3X)*
617 extended_pair_content/\fBcurs_color\fP(3X)*
618 extended_slk_color/\fBcurs_slk\fP(3X)*
619 filter/\fBcurs_util\fP(3X)
620 find_pair/\fBnew_pair\fP(3X)*
621 flash/\fBcurs_beep\fP(3X)
622 flushinp/\fBcurs_util\fP(3X)
623 free_pair/\fBnew_pair\fP(3X)*
624 get_escdelay/\fBcurs_threads\fP(3X)*
625 get_wch/\fBcurs_get_wch\fP(3X)
626 get_wstr/\fBcurs_get_wstr\fP(3X)
627 getattrs/\fBcurs_attr\fP(3X)
628 getbegx/\fBcurs_legacy\fP(3X)*
629 getbegy/\fBcurs_legacy\fP(3X)*
630 getbegyx/\fBcurs_getyx\fP(3X)
631 getbkgd/\fBcurs_bkgd\fP(3X)
632 getbkgrnd/\fBcurs_bkgrnd\fP(3X)
633 getcchar/\fBcurs_getcchar\fP(3X)
634 getch/\fBcurs_getch\fP(3X)
635 getcurx/\fBcurs_legacy\fP(3X)*
636 getcury/\fBcurs_legacy\fP(3X)*
637 getmaxx/\fBcurs_legacy\fP(3X)*
638 getmaxy/\fBcurs_legacy\fP(3X)*
639 getmaxyx/\fBcurs_getyx\fP(3X)
640 getmouse/\fBcurs_mouse\fP(3X)*
641 getn_wstr/\fBcurs_get_wstr\fP(3X)
642 getnstr/\fBcurs_getstr\fP(3X)
643 getparx/\fBcurs_legacy\fP(3X)*
644 getpary/\fBcurs_legacy\fP(3X)*
645 getparyx/\fBcurs_getyx\fP(3X)
646 getstr/\fBcurs_getstr\fP(3X)
647 getsyx/\fBcurs_kernel\fP(3X)
648 getwin/\fBcurs_util\fP(3X)
649 getyx/\fBcurs_getyx\fP(3X)
650 halfdelay/\fBcurs_inopts\fP(3X)
651 has_colors/\fBcurs_color\fP(3X)
652 has_ic/\fBcurs_termattrs\fP(3X)
653 has_il/\fBcurs_termattrs\fP(3X)
654 has_key/\fBcurs_getch\fP(3X)*
655 has_mouse/\fBcurs_mouse\fP(3X)*
656 hline/\fBcurs_border\fP(3X)
657 hline_set/\fBcurs_border_set\fP(3X)
658 idcok/\fBcurs_outopts\fP(3X)
659 idlok/\fBcurs_outopts\fP(3X)
660 immedok/\fBcurs_outopts\fP(3X)
661 in_wch/\fBcurs_in_wch\fP(3X)
662 in_wchnstr/\fBcurs_in_wchstr\fP(3X)
663 in_wchstr/\fBcurs_in_wchstr\fP(3X)
664 inch/\fBcurs_inch\fP(3X)
665 inchnstr/\fBcurs_inchstr\fP(3X)
666 inchstr/\fBcurs_inchstr\fP(3X)
667 init_color/\fBcurs_color\fP(3X)
668 init_extended_color/\fBcurs_color\fP(3X)*
669 init_extended_pair/\fBcurs_color\fP(3X)*
670 init_pair/\fBcurs_color\fP(3X)
671 initscr/\fBcurs_initscr\fP(3X)
672 innstr/\fBcurs_instr\fP(3X)
673 innwstr/\fBcurs_inwstr\fP(3X)
674 ins_nwstr/\fBcurs_ins_wstr\fP(3X)
675 ins_wch/\fBcurs_ins_wch\fP(3X)
676 ins_wstr/\fBcurs_ins_wstr\fP(3X)
677 insch/\fBcurs_insch\fP(3X)
678 insdelln/\fBcurs_deleteln\fP(3X)
679 insertln/\fBcurs_deleteln\fP(3X)
680 insnstr/\fBcurs_insstr\fP(3X)
681 insstr/\fBcurs_insstr\fP(3X)
682 instr/\fBcurs_instr\fP(3X)
683 intrflush/\fBcurs_inopts\fP(3X)
684 inwstr/\fBcurs_inwstr\fP(3X)
685 is_cbreak/\fBcurs_inopts\fP(3X)*
686 is_cleared/\fBcurs_opaque\fP(3X)*
687 is_echo/\fBcurs_inopts\fP(3X)*
688 is_idcok/\fBcurs_opaque\fP(3X)*
689 is_idlok/\fBcurs_opaque\fP(3X)*
690 is_immedok/\fBcurs_opaque\fP(3X)*
691 is_keypad/\fBcurs_opaque\fP(3X)*
692 is_leaveok/\fBcurs_opaque\fP(3X)*
693 is_linetouched/\fBcurs_touch\fP(3X)
694 is_nl/\fBcurs_inopts\fP(3X)*
695 is_nodelay/\fBcurs_opaque\fP(3X)*
696 is_notimeout/\fBcurs_opaque\fP(3X)*
697 is_pad/\fBcurs_opaque\fP(3X)*
698 is_raw/\fBcurs_inopts\fP(3X)*
699 is_scrollok/\fBcurs_opaque\fP(3X)*
700 is_subwin/\fBcurs_opaque\fP(3X)*
701 is_syncok/\fBcurs_opaque\fP(3X)*
702 is_term_resized/\fBresizeterm\fP(3X)*
703 is_wintouched/\fBcurs_touch\fP(3X)
704 isendwin/\fBcurs_initscr\fP(3X)
705 key_defined/\fBkey_defined\fP(3X)*
706 key_name/\fBcurs_util\fP(3X)
707 keybound/\fBkeybound\fP(3X)*
708 keyname/\fBcurs_util\fP(3X)
709 keyok/\fBkeyok\fP(3X)*
710 keypad/\fBcurs_inopts\fP(3X)
711 killchar/\fBcurs_termattrs\fP(3X)
712 killwchar/\fBcurs_termattrs\fP(3X)
713 leaveok/\fBcurs_outopts\fP(3X)
714 longname/\fBcurs_termattrs\fP(3X)
715 mcprint/\fBcurs_print\fP(3X)*
716 meta/\fBcurs_inopts\fP(3X)
717 mouse_trafo/\fBcurs_mouse\fP(3X)*
718 mouseinterval/\fBcurs_mouse\fP(3X)*
719 mousemask/\fBcurs_mouse\fP(3X)*
720 move/\fBcurs_move\fP(3X)
721 mvadd_wch/\fBcurs_add_wch\fP(3X)
722 mvadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
723 mvadd_wchstr/\fBcurs_add_wchstr\fP(3X)
724 mvaddch/\fBcurs_addch\fP(3X)
725 mvaddchnstr/\fBcurs_addchstr\fP(3X)
726 mvaddchstr/\fBcurs_addchstr\fP(3X)
727 mvaddnstr/\fBcurs_addstr\fP(3X)
728 mvaddnwstr/\fBcurs_addwstr\fP(3X)
729 mvaddstr/\fBcurs_addstr\fP(3X)
730 mvaddwstr/\fBcurs_addwstr\fP(3X)
731 mvchgat/\fBcurs_attr\fP(3X)
732 mvcur/\fBcurs_terminfo\fP(3X)
733 mvdelch/\fBcurs_delch\fP(3X)
734 mvderwin/\fBcurs_window\fP(3X)
735 mvget_wch/\fBcurs_get_wch\fP(3X)
736 mvget_wstr/\fBcurs_get_wstr\fP(3X)
737 mvgetch/\fBcurs_getch\fP(3X)
738 mvgetn_wstr/\fBcurs_get_wstr\fP(3X)
739 mvgetnstr/\fBcurs_getstr\fP(3X)
740 mvgetstr/\fBcurs_getstr\fP(3X)
741 mvhline/\fBcurs_border\fP(3X)
742 mvhline_set/\fBcurs_border_set\fP(3X)
743 mvin_wch/\fBcurs_in_wch\fP(3X)
744 mvin_wchnstr/\fBcurs_in_wchstr\fP(3X)
745 mvin_wchstr/\fBcurs_in_wchstr\fP(3X)
746 mvinch/\fBcurs_inch\fP(3X)
747 mvinchnstr/\fBcurs_inchstr\fP(3X)
748 mvinchstr/\fBcurs_inchstr\fP(3X)
749 mvinnstr/\fBcurs_instr\fP(3X)
750 mvinnwstr/\fBcurs_inwstr\fP(3X)
751 mvins_nwstr/\fBcurs_ins_wstr\fP(3X)
752 mvins_wch/\fBcurs_ins_wch\fP(3X)
753 mvins_wstr/\fBcurs_ins_wstr\fP(3X)
754 mvinsch/\fBcurs_insch\fP(3X)
755 mvinsnstr/\fBcurs_insstr\fP(3X)
756 mvinsstr/\fBcurs_insstr\fP(3X)
757 mvinstr/\fBcurs_instr\fP(3X)
758 mvinwstr/\fBcurs_inwstr\fP(3X)
759 mvprintw/\fBcurs_printw\fP(3X)
760 mvscanw/\fBcurs_scanw\fP(3X)
761 mvvline/\fBcurs_border\fP(3X)
762 mvvline_set/\fBcurs_border_set\fP(3X)
763 mvwadd_wch/\fBcurs_add_wch\fP(3X)
764 mvwadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
765 mvwadd_wchstr/\fBcurs_add_wchstr\fP(3X)
766 mvwaddch/\fBcurs_addch\fP(3X)
767 mvwaddchnstr/\fBcurs_addchstr\fP(3X)
768 mvwaddchstr/\fBcurs_addchstr\fP(3X)
769 mvwaddnstr/\fBcurs_addstr\fP(3X)
770 mvwaddnwstr/\fBcurs_addwstr\fP(3X)
771 mvwaddstr/\fBcurs_addstr\fP(3X)
772 mvwaddwstr/\fBcurs_addwstr\fP(3X)
773 mvwchgat/\fBcurs_attr\fP(3X)
774 mvwdelch/\fBcurs_delch\fP(3X)
775 mvwget_wch/\fBcurs_get_wch\fP(3X)
776 mvwget_wstr/\fBcurs_get_wstr\fP(3X)
777 mvwgetch/\fBcurs_getch\fP(3X)
778 mvwgetn_wstr/\fBcurs_get_wstr\fP(3X)
779 mvwgetnstr/\fBcurs_getstr\fP(3X)
780 mvwgetstr/\fBcurs_getstr\fP(3X)
781 mvwhline/\fBcurs_border\fP(3X)
782 mvwhline_set/\fBcurs_border_set\fP(3X)
783 mvwin/\fBcurs_window\fP(3X)
784 mvwin_wch/\fBcurs_in_wch\fP(3X)
785 mvwin_wchnstr/\fBcurs_in_wchstr\fP(3X)
786 mvwin_wchstr/\fBcurs_in_wchstr\fP(3X)
787 mvwinch/\fBcurs_inch\fP(3X)
788 mvwinchnstr/\fBcurs_inchstr\fP(3X)
789 mvwinchstr/\fBcurs_inchstr\fP(3X)
790 mvwinnstr/\fBcurs_instr\fP(3X)
791 mvwinnwstr/\fBcurs_inwstr\fP(3X)
792 mvwins_nwstr/\fBcurs_ins_wstr\fP(3X)
793 mvwins_wch/\fBcurs_ins_wch\fP(3X)
794 mvwins_wstr/\fBcurs_ins_wstr\fP(3X)
795 mvwinsch/\fBcurs_insch\fP(3X)
796 mvwinsnstr/\fBcurs_insstr\fP(3X)
797 mvwinsstr/\fBcurs_insstr\fP(3X)
798 mvwinstr/\fBcurs_instr\fP(3X)
799 mvwinwstr/\fBcurs_inwstr\fP(3X)
800 mvwprintw/\fBcurs_printw\fP(3X)
801 mvwscanw/\fBcurs_scanw\fP(3X)
802 mvwvline/\fBcurs_border\fP(3X)
803 mvwvline_set/\fBcurs_border_set\fP(3X)
804 napms/\fBcurs_kernel\fP(3X)
805 newpad/\fBcurs_pad\fP(3X)
806 newterm/\fBcurs_initscr\fP(3X)
807 newwin/\fBcurs_window\fP(3X)
808 nl/\fBcurs_inopts\fP(3X)
809 nocbreak/\fBcurs_inopts\fP(3X)
810 nodelay/\fBcurs_inopts\fP(3X)
811 noecho/\fBcurs_inopts\fP(3X)
812 nofilter/\fBcurs_util\fP(3X)*
813 nonl/\fBcurs_inopts\fP(3X)
814 noqiflush/\fBcurs_inopts\fP(3X)
815 noraw/\fBcurs_inopts\fP(3X)
816 notimeout/\fBcurs_inopts\fP(3X)
817 overlay/\fBcurs_overlay\fP(3X)
818 overwrite/\fBcurs_overlay\fP(3X)
819 pair_content/\fBcurs_color\fP(3X)
820 pecho_wchar/\fBcurs_pad\fP(3X)
821 pechochar/\fBcurs_pad\fP(3X)
822 pnoutrefresh/\fBcurs_pad\fP(3X)
823 prefresh/\fBcurs_pad\fP(3X)
824 printw/\fBcurs_printw\fP(3X)
825 putp/\fBcurs_terminfo\fP(3X)
826 putwin/\fBcurs_util\fP(3X)
827 qiflush/\fBcurs_inopts\fP(3X)
828 raw/\fBcurs_inopts\fP(3X)
829 redrawwin/\fBcurs_refresh\fP(3X)
830 refresh/\fBcurs_refresh\fP(3X)
831 reset_color_pairs/\fBcurs_color\fP(3X)*
832 reset_prog_mode/\fBcurs_kernel\fP(3X)
833 reset_shell_mode/\fBcurs_kernel\fP(3X)
834 resetty/\fBcurs_kernel\fP(3X)
835 resize_term/\fBresizeterm\fP(3X)*
836 resizeterm/\fBresizeterm\fP(3X)*
837 restartterm/\fBcurs_terminfo\fP(3X)
838 ripoffline/\fBcurs_kernel\fP(3X)
839 savetty/\fBcurs_kernel\fP(3X)
840 scanw/\fBcurs_scanw\fP(3X)
841 scr_dump/\fBcurs_scr_dump\fP(3X)
842 scr_init/\fBcurs_scr_dump\fP(3X)
843 scr_restore/\fBcurs_scr_dump\fP(3X)
844 scr_set/\fBcurs_scr_dump\fP(3X)
845 scrl/\fBcurs_scroll\fP(3X)
846 scroll/\fBcurs_scroll\fP(3X)
847 scrollok/\fBcurs_outopts\fP(3X)
848 set_curterm/\fBcurs_terminfo\fP(3X)
849 set_escdelay/\fBcurs_threads\fP(3X)*
850 set_tabsize/\fBcurs_threads\fP(3X)*
851 set_term/\fBcurs_initscr\fP(3X)
852 setcchar/\fBcurs_getcchar\fP(3X)
853 setscrreg/\fBcurs_outopts\fP(3X)
854 setsyx/\fBcurs_kernel\fP(3X)
855 setupterm/\fBcurs_terminfo\fP(3X)
856 slk_attr/\fBcurs_slk\fP(3X)*
857 slk_attr_off/\fBcurs_slk\fP(3X)
858 slk_attr_on/\fBcurs_slk\fP(3X)
859 slk_attr_set/\fBcurs_slk\fP(3X)
860 slk_attroff/\fBcurs_slk\fP(3X)
861 slk_attron/\fBcurs_slk\fP(3X)
862 slk_attrset/\fBcurs_slk\fP(3X)
863 slk_clear/\fBcurs_slk\fP(3X)
864 slk_color/\fBcurs_slk\fP(3X)
865 slk_init/\fBcurs_slk\fP(3X)
866 slk_label/\fBcurs_slk\fP(3X)
867 slk_noutrefresh/\fBcurs_slk\fP(3X)
868 slk_refresh/\fBcurs_slk\fP(3X)
869 slk_restore/\fBcurs_slk\fP(3X)
870 slk_set/\fBcurs_slk\fP(3X)
871 slk_touch/\fBcurs_slk\fP(3X)
872 slk_wset/\fBcurs_slk\fP(3X)
873 standend/\fBcurs_attr\fP(3X)
874 standout/\fBcurs_attr\fP(3X)
875 start_color/\fBcurs_color\fP(3X)
876 subpad/\fBcurs_pad\fP(3X)
877 subwin/\fBcurs_window\fP(3X)
878 syncok/\fBcurs_window\fP(3X)
879 term_attrs/\fBcurs_termattrs\fP(3X)
880 termattrs/\fBcurs_termattrs\fP(3X)
881 termname/\fBcurs_termattrs\fP(3X)
882 tgetent/\fBcurs_termcap\fP(3X)
883 tgetflag/\fBcurs_termcap\fP(3X)
884 tgetnum/\fBcurs_termcap\fP(3X)
885 tgetstr/\fBcurs_termcap\fP(3X)
886 tgoto/\fBcurs_termcap\fP(3X)
887 tigetflag/\fBcurs_terminfo\fP(3X)
888 tigetnum/\fBcurs_terminfo\fP(3X)
889 tigetstr/\fBcurs_terminfo\fP(3X)
890 timeout/\fBcurs_inopts\fP(3X)
891 tiparm/\fBcurs_terminfo\fP(3X)
892 tiparm_s/\fBcurs_terminfo\fP(3X)*
893 tiscan_s/\fBcurs_terminfo\fP(3X)*
894 touchline/\fBcurs_touch\fP(3X)
895 touchwin/\fBcurs_touch\fP(3X)
896 tparm/\fBcurs_terminfo\fP(3X)
897 tputs/\fBcurs_termcap\fP(3X)
898 tputs/\fBcurs_terminfo\fP(3X)
899 trace/\fBcurs_trace\fP(3X)*
900 typeahead/\fBcurs_inopts\fP(3X)
901 unctrl/\fBcurs_util\fP(3X)
902 unget_wch/\fBcurs_get_wch\fP(3X)
903 ungetch/\fBcurs_getch\fP(3X)
904 ungetmouse/\fBcurs_mouse\fP(3X)*
905 untouchwin/\fBcurs_touch\fP(3X)
906 use_default_colors/\fBdefault_colors\fP(3X)*
907 use_env/\fBcurs_util\fP(3X)
908 use_extended_names/\fBcurs_extend\fP(3X)*
909 use_legacy_coding/\fBlegacy_coding\fP(3X)*
910 use_screen/\fBcurs_threads\fP(3X)*
911 use_tioctl/\fBcurs_util\fP(3X)*
912 use_window/\fBcurs_threads\fP(3X)*
913 vid_attr/\fBcurs_terminfo\fP(3X)
914 vid_puts/\fBcurs_terminfo\fP(3X)
915 vidattr/\fBcurs_terminfo\fP(3X)
916 vidputs/\fBcurs_terminfo\fP(3X)
917 vline/\fBcurs_border\fP(3X)
918 vline_set/\fBcurs_border_set\fP(3X)
919 vw_printw/\fBcurs_printw\fP(3X)
920 vw_scanw/\fBcurs_scanw\fP(3X)
921 vwprintw/\fBcurs_printw\fP(3X)
922 vwscanw/\fBcurs_scanw\fP(3X)
923 wadd_wch/\fBcurs_add_wch\fP(3X)
924 wadd_wchnstr/\fBcurs_add_wchstr\fP(3X)
925 wadd_wchstr/\fBcurs_add_wchstr\fP(3X)
926 waddch/\fBcurs_addch\fP(3X)
927 waddchnstr/\fBcurs_addchstr\fP(3X)
928 waddchstr/\fBcurs_addchstr\fP(3X)
929 waddnstr/\fBcurs_addstr\fP(3X)
930 waddnwstr/\fBcurs_addwstr\fP(3X)
931 waddstr/\fBcurs_addstr\fP(3X)
932 waddwstr/\fBcurs_addwstr\fP(3X)
933 wattr_get/\fBcurs_attr\fP(3X)
934 wattr_off/\fBcurs_attr\fP(3X)
935 wattr_on/\fBcurs_attr\fP(3X)
936 wattr_set/\fBcurs_attr\fP(3X)
937 wattroff/\fBcurs_attr\fP(3X)
938 wattron/\fBcurs_attr\fP(3X)
939 wattrset/\fBcurs_attr\fP(3X)
940 wbkgd/\fBcurs_bkgd\fP(3X)
941 wbkgdset/\fBcurs_bkgd\fP(3X)
942 wbkgrnd/\fBcurs_bkgrnd\fP(3X)
943 wbkgrndset/\fBcurs_bkgrnd\fP(3X)
944 wborder/\fBcurs_border\fP(3X)
945 wborder_set/\fBcurs_border_set\fP(3X)
946 wchgat/\fBcurs_attr\fP(3X)
947 wclear/\fBcurs_clear\fP(3X)
948 wclrtobot/\fBcurs_clear\fP(3X)
949 wclrtoeol/\fBcurs_clear\fP(3X)
950 wcolor_set/\fBcurs_attr\fP(3X)
951 wcursyncup/\fBcurs_window\fP(3X)
952 wdelch/\fBcurs_delch\fP(3X)
953 wdeleteln/\fBcurs_deleteln\fP(3X)
954 wecho_wchar/\fBcurs_add_wch\fP(3X)
955 wechochar/\fBcurs_addch\fP(3X)
956 wenclose/\fBcurs_mouse\fP(3X)*
957 werase/\fBcurs_clear\fP(3X)
958 wget_wch/\fBcurs_get_wch\fP(3X)
959 wget_wstr/\fBcurs_get_wstr\fP(3X)
960 wgetbkgrnd/\fBcurs_bkgrnd\fP(3X)
961 wgetch/\fBcurs_getch\fP(3X)
962 wgetdelay/\fBcurs_opaque\fP(3X)*
963 wgetn_wstr/\fBcurs_get_wstr\fP(3X)
964 wgetnstr/\fBcurs_getstr\fP(3X)
965 wgetparent/\fBcurs_opaque\fP(3X)*
966 wgetscrreg/\fBcurs_opaque\fP(3X)*
967 wgetstr/\fBcurs_getstr\fP(3X)
968 whline/\fBcurs_border\fP(3X)
969 whline_set/\fBcurs_border_set\fP(3X)
970 win_wch/\fBcurs_in_wch\fP(3X)
971 win_wchnstr/\fBcurs_in_wchstr\fP(3X)
972 win_wchstr/\fBcurs_in_wchstr\fP(3X)
973 winch/\fBcurs_inch\fP(3X)
974 winchnstr/\fBcurs_inchstr\fP(3X)
975 winchstr/\fBcurs_inchstr\fP(3X)
976 winnstr/\fBcurs_instr\fP(3X)
977 winnwstr/\fBcurs_inwstr\fP(3X)
978 wins_nwstr/\fBcurs_ins_wstr\fP(3X)
979 wins_wch/\fBcurs_ins_wch\fP(3X)
980 wins_wstr/\fBcurs_ins_wstr\fP(3X)
981 winsch/\fBcurs_insch\fP(3X)
982 winsdelln/\fBcurs_deleteln\fP(3X)
983 winsertln/\fBcurs_deleteln\fP(3X)
984 winsnstr/\fBcurs_insstr\fP(3X)
985 winsstr/\fBcurs_insstr\fP(3X)
986 winstr/\fBcurs_instr\fP(3X)
987 winwstr/\fBcurs_inwstr\fP(3X)
988 wmouse_trafo/\fBcurs_mouse\fP(3X)*
989 wmove/\fBcurs_move\fP(3X)
990 wnoutrefresh/\fBcurs_refresh\fP(3X)
991 wprintw/\fBcurs_printw\fP(3X)
992 wredrawln/\fBcurs_refresh\fP(3X)
993 wrefresh/\fBcurs_refresh\fP(3X)
994 wresize/\fBwresize\fP(3X)*
995 wscanw/\fBcurs_scanw\fP(3X)
996 wscrl/\fBcurs_scroll\fP(3X)
997 wsetscrreg/\fBcurs_outopts\fP(3X)
998 wstandend/\fBcurs_attr\fP(3X)
999 wstandout/\fBcurs_attr\fP(3X)
1000 wsyncdown/\fBcurs_window\fP(3X)
1001 wsyncup/\fBcurs_window\fP(3X)
1002 wtimeout/\fBcurs_inopts\fP(3X)
1003 wtouchln/\fBcurs_touch\fP(3X)
1004 wunctrl/\fBcurs_util\fP(3X)
1005 wvline/\fBcurs_border\fP(3X)
1006 wvline_set/\fBcurs_border_set\fP(3X)
1010 .I "screen-pointer extension"
1011 adds additional functions corresponding to many of the above,
1012 each with an \*(``_sp\*('' suffix;
1013 see \fBcurs_sp_funcs\fP(3X).
1015 The availability of some extensions is configurable when
1018 see sections \*(``ALTERNATE CONFIGURATIONS\*('' and \*(``EXTENSIONS\*(''
1021 Unless otherwise noted,
1022 functions that return an integer return
1027 Functions that return pointers return
1032 treats a null pointer passed as a function parameter as a failure.
1033 Functions with a \*(``mv\*('' prefix first perform cursor movement using
1034 \fB\%wmove\fP(3X) and fail if the position is outside the window.
1036 The following symbols from the process environment customize the
1040 The library may be configured to disregard the variables
1042 .IR \%TERMINFO_DIRS ,
1046 if the user is the superuser (root),
1047 or the application uses \fI\%setuid\fP(2) or \fI\%setgid\fP(2).
1048 .SS "\fIBAUDRATE\fP"
1049 The debugging library checks this variable when the application has
1050 redirected output to a file.
1051 Its integral value is used for the baud rate.
1052 If that value is absent or invalid,
1055 This feature allows testers to construct repeatable test cases
1056 that take into account optimization decisions that depend on baud rate.
1057 .SS "\fICC\fP (command character)"
1060 .B \%command_character
1062 capability value of loaded
1064 entries changes to the value of this variable.
1067 entries provide this feature.
1069 Because this name is also used in development environments to represent
1070 the C compiler's name,
1072 ignores its value if it is not one character in length.
1074 This variable specifies the width of the screen in characters.
1075 Applications running in a windowing environment usually are able to
1076 obtain the width of the window in which they are executing.
1079 is not defined and the terminal's screen size is not available from the
1082 uses the size specified by the
1085 capability of the terminal type's entry in the
1090 It is important that your application use the correct screen size.
1091 Automatic detection thereof is not always possible because an
1092 application may be running on a host that does not honor NAWS
1093 (Negotiations About Window Size)
1094 or as a different user ID than the owner of the terminal device file.
1099 overrides the library's use of the screen size obtained from the
1106 variables may be specified independently.
1107 This property is useful to circumvent misfeatures of legacy terminal
1109 \fI\%xterm\fP(1) descriptions specifying 65 lines were once notorious.
1117 descriptions of terminal emulators.
1119 \fBuse_env\fP(3X) can disable use of the process environment
1120 in determining the screen size.
1121 \fBuse_tioctl\fP(3X) can update
1125 to match the screen size obtained from system calls or the terminal
1127 .SS "\fIESCDELAY\fP"
1130 to distinguish the ESC character resulting from a user's press of the
1131 \*(``Escape\*('' key on the input device from one beginning an
1132 .I "escape sequence"
1133 (as commonly produced by function keys),
1134 it waits after receiving the escape character to see if further
1135 characters are available on the input stream within a short interval.
1138 stores this interval in milliseconds.
1139 The default value of 1000
1141 is adequate for most uses.
1142 This environment variable overrides it.
1144 The most common instance where you may wish to change this value
1145 is to work with a remote host over a slow communication channel.
1146 If the host running a
1148 application does not receive the characters of an escape sequence in a
1150 the library can interpret them as multiple key stroke events.
1152 \fI\%xterm\fP(1) mouse events are a form of escape sequence;
1154 if your application makes heavy use of multiple-clicking,
1155 you may wish to lengthen the default value because the delay applies
1156 to the composite multi-click event as well as the individual clicks.
1158 Portable applications should not rely upon the presence of
1161 but setting the environment variable rather than the global variable
1162 does not create problems when compiling an application.
1164 If \fB\%keypad\fP(3X) is disabled for the
1166 window receiving input,
1167 a program must disambiguate escape sequences itself.
1170 may read and write auxiliary terminal descriptions in
1174 files in the user's home directory.
1178 specifies the height of the screen in characters.
1181 capability and code is
1183 See the description of the
1186 .SS "\fIMOUSE_BUTTONS_123\fP"
1187 (OS/2 EMX port only)
1188 OS/2 numbers a three-button mouse inconsistently with other platforms,
1189 such that 1 is the left button,
1192 This variable customizes the mouse button numbering.
1193 Its value must be three digits 1\-3 in any order.
1196 assumes a numbering of \*(``132\*(''.
1197 .SS "\fINCURSES_ASSUMED_COLORS\fP"
1199 this variable overrides the
1201 library's compiled-in assumption that the terminal's default colors are
1203 see \fB\%default_colors\fP(3X).
1204 Set the foreground and background color values with this environment
1205 variable by assigning it two integer values separated by a comma,
1206 indicating foregound and background color numbers,
1212 not to assume anything about the colors,
1213 use a value of \*(``\-1,\-1\*(''.
1214 To make the default color scheme green on black,
1217 accepts integral values from \-1 up to the value of the
1222 .SS "\fINCURSES_CONSOLE2\fP"
1226 .\" https://www.hanselman.com/blog/console2-a-better-windows-command-prompt
1227 program defectively handles the Microsoft Console API call
1228 .IR \%Create\%Console\%Screen\%Buffer .
1229 Applications that use it will hang.
1231 it is possible to simulate the action of this call by mapping
1233 explicitly saving and restoring the original screen contents.
1234 Setting the environment variable
1236 has the same effect.
1237 .SS "\fINCURSES_GPM_TERMS\fP"
1241 is configured to use the GPM interface,
1242 this variable may list one or more terminal names
1248 An empty value disables the GPM interface,
1251 built-in support for \fIxterm\fP(1) mouse protocols instead.
1252 If the variable is absent,
1254 attempts to open GPM if
1256 contains \*(``linux\*(''.
1257 .SS "\fINCURSES_NO_HARD_TABS\fP"
1259 may use tab characters in cursor movement optimization.
1261 your terminal driver may not handle them properly.
1262 Set this environment variable to any value to disable the feature.
1263 You can also adjust your \fI\%stty\fP(1) settings to avoid the problem.
1264 .SS "\fINCURSES_NO_MAGIC_COOKIE\fP"
1265 Many terminals store video attributes as a property of a character cell,
1270 some recorded changes in video attributes as data that logically
1272 character cells on the display,
1273 switching attributes on or off,
1274 similarly to tags in a markup language;
1275 these are termed \*(``magic cookies\*('',
1276 and must be subsequently overprinted.
1279 entry for your terminal type does not adequately describe its handling
1281 set this variable to any value to instruct
1283 to disable attributes entirely.
1284 .SS "\fINCURSES_NO_PADDING\fP"
1285 Most terminal type descriptions in the
1287 database detail hardware devices.
1290 applications in terminal emulator programs that run in a windowing
1292 These programs can duplicate all of the important features of a hardware
1294 but often lack their limitations.
1295 Chief among these absent drawbacks is the problem of data flow
1298 limiting the speed of communication to what the hardware could handle.
1299 Unless a hardware terminal is interfaced into a terminal concentrator
1300 (which does flow control),
1301 an application must manage flow control itself to prevent overruns and
1304 A solution that comes at no hardware cost is for an application to pause
1305 after directing a terminal to execute an operation that it performs
1307 such as clearing the display.
1308 Many terminal type descriptions,
1309 including that for the VT100,
1310 embed delay specifications in capabilities.
1311 You may wish to use these temrinal descriptions without paying the
1312 performance penalty.
1314 .I \%NCURSES_NO_PADDING
1315 to any value to disable all but mandatory padding.
1316 Mandatory padding is used by such terminal capabilities as
1319 .SS "\fINCURSES_NO_SETBUF\fP"
1321 Prior to internal changes developed in
1324 (patches 20120825 through 20130126),
1325 the library used \fI\%setbuf\fP(3) to enable fully buffered output when
1326 initializing the terminal.
1330 to increase performance.
1331 For testing purposes,
1334 and of certain applications,
1335 this feature was made optional.
1336 Setting this variable disabled output buffering,
1337 leaving the output stream in the original
1338 (usually line-buffered)
1343 performs its own buffering and does not require this workaround;
1344 it does not modify the buffering of the standard output stream.
1345 This approach makes signal handling,
1348 A drawback is that certain unconventional programs mixed
1349 \fI\%stdio\fP(3) calls with
1352 got the behavior they expected.
1353 This is no longer the case;
1355 does not write to the standard output file descriptor through a
1360 low-level API calls such as \fB\%putp\fP(3X) still use the
1361 standard output stream.
1364 calls such as \fB\%printw\fP(3X) do not.
1365 .SS "\fINCURSES_NO_UTF8_ACS\fP"
1370 environment variable for special cases where VT100 forms-drawing
1372 (and the corresponding alternate character set
1375 are known to be unsupported by terminal types that otherwise claim VT100
1378 when running in a UTF-8 locale,
1379 the Linux virtual console device and the GNU \fI\%screen\fP(1)
1380 program ignore them.
1381 Set this variable to a nonzero value to instruct
1383 that the terminal's ACS support is broken;
1384 the library then outputs Unicode code points that correspond to the
1389 to disable the special check for terminal type names matching
1390 \*(``linux\*('' or \*(``screen\*('',
1393 to assume that the ACS feature works if the terminal type description
1396 As an alternative to use of this variable,
1398 checks for an extended
1400 numeric capability \fBU8\fP
1401 that can be compiled using
1402 .RB \*(`` "@TIC@ \-x" \*(''.
1407 # linux console, if patched to provide working
1408 # VT100 shift\-in/shift\-out, with corresponding font.
1409 linux\-vt100|linux console with VT100 line\-graphics,
1412 # uxterm with vt100Graphics resource set to false
1413 xterm\-utf8|xterm relying on UTF\-8 line\-graphics,
1418 The two-character name \*(``U8\*('' was chosen to permit its use via
1422 .SS "\fINCURSES_TRACE\fP"
1425 (in its debugging configuration)
1426 checks for this variable's presence.
1427 If defined with an integral value,
1428 the library calls \fB\%curses_trace\fP(3X) with that value as the
1431 Denotes your terminal type.
1432 Each terminal type is distinct, though many are similar.
1434 \fITERM\fP is commonly set by terminal emulators to help
1435 applications find a workable terminal description.
1436 Some of those choose a popular approximation, e.g.,
1437 \*(``ansi\*('', \*(``vt100\*('', \*(``xterm\*('' rather than an exact fit.
1438 Not infrequently, your application will have problems with that approach,
1439 e.g., incorrect function-key definitions.
1441 If you set \fITERM\fP in your environment,
1442 it has no effect on the operation of the terminal emulator.
1443 It only affects the way applications work within the terminal.
1444 Likewise, as a general rule (\fBxterm\fP(1) being a rare exception),
1445 terminal emulators which allow you to
1446 specify \fITERM\fP as a parameter or configuration value do
1447 not change their behavior to match that setting.
1449 If the \fI\%ncurses\fP library has been configured with \fItermcap\fP
1450 support, \fI\%ncurses\fP will check for a terminal's description in
1451 termcap form if it is not available in the terminfo database.
1453 The \fI\%TERMCAP\fP environment variable contains
1454 either a terminal description (with newlines stripped out),
1455 or a file name telling where the information denoted by
1456 the \fITERM\fP environment variable exists.
1457 In either case, setting it directs \fI\%ncurses\fP to ignore
1458 the usual place for this information, e.g., /etc/termcap.
1459 .SS "\fITERMINFO\fP"
1460 \fI\%ncurses\fP can be configured to read from multiple terminal
1462 The \fI\%TERMINFO\fP variable overrides the location for
1463 the default terminal database.
1464 Terminal descriptions (in terminal format) are stored in terminal databases:
1466 Normally these are stored in a directory tree,
1467 using subdirectories named by the first letter of the terminal names therein.
1469 This is the scheme used in System V, which legacy Unix systems use,
1470 and the \fI\%TERMINFO\fP variable is used by \fIcurses\fP applications
1472 systems to override the default location of the terminal database.
1474 If \fI\%ncurses\fP is built to use hashed databases,
1475 then each entry in this list may be the path of a hashed database file, e.g.,
1480 /usr/share/terminfo.db
1488 /usr/share/terminfo/
1492 The hashed database uses less disk-space and is a little faster than the
1495 some applications assume the existence of the directory tree,
1497 rather than using the terminfo library calls.
1500 If \fI\%ncurses\fP is built with a support for reading termcap files
1501 directly, then an entry in this list may be the path of a termcap file.
1503 If the \fI\%TERMINFO\fP variable begins with
1504 \*(``hex:\*('' or \*(``b64:\*('',
1505 \fI\%ncurses\fP uses the remainder of that variable as a compiled
1506 terminal description.
1507 You might produce the base64 format using \fBinfocmp\fP(1M):
1512 TERMINFO="$(infocmp \-0 \-Q2 \-q)"
1517 The compiled description is used if it corresponds to the terminal identified
1518 by the \fITERM\fP variable.
1521 Setting \fI\%TERMINFO\fP is the simplest,
1522 but not the only way to set location of the default terminal database.
1523 The complete list of database locations in order follows:
1526 the last terminal database to which \fI\%ncurses\fP wrote,
1527 if any, is searched first
1529 the location specified by the \fI\%TERMINFO\fP environment variable
1533 locations listed in the \fI\%TERMINFO_DIRS\fP environment variable
1535 one or more locations whose names are configured and compiled into the
1536 \fI\%ncurses\fP library, i.e.,
1539 @TERMINFO_DIRS@ (corresponding to the \fI\%TERMINFO_DIRS\fP variable)
1541 @TERMINFO@ (corresponding to the \fITERMINFO\fP variable)
1544 .SS "\fITERMINFO_DIRS\fP"
1545 Specifies a list of locations to search for terminal descriptions.
1546 Each location in the list is a terminal database as described in
1547 the section on the \fI\%TERMINFO\fP variable.
1548 The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
1550 There is no corresponding feature in System V terminfo;
1551 it is an extension developed for \fI\%ncurses\fP.
1552 .SS "\fITERMPATH\fP"
1553 If \fI\%TERMCAP\fP does not hold a file name then \fI\%ncurses\fP checks
1554 the \fI\%TERMPATH\fP environment variable.
1555 This is a list of filenames separated by spaces or colons (i.e., ":") on Unix,
1556 semicolons on OS/2 EMX.
1558 If the \fI\%TERMPATH\fP environment variable is not set,
1559 \fI\%ncurses\fP looks in the files
1563 /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap,
1568 .SH "ALTERNATE CONFIGURATIONS"
1571 configurations are possible,
1572 determined by the options given to the
1574 script when building the library.
1575 Run the script with the
1577 option to peruse them all.
1578 A few are of particular significance to the application developer
1582 \-\-disable\-overwrite
1583 The standard include for \fI\%ncurses\fP is as noted in \fBSYNOPSIS\fP:
1588 \fB#include <curses.h>\fP
1592 This option is used to avoid filename conflicts when \fI\%ncurses\fP
1593 is not the main implementation of curses of the computer.
1594 If \fI\%ncurses\fP is installed disabling overwrite,
1595 it puts its headers in a subdirectory,
1600 \fB#include <ncurses/curses.h>\fP
1604 It also omits a symbolic link which would allow you to use \fB\-lcurses\fP
1605 to build executables.
1609 The configure script renames the library and
1610 (if the \fB\-\-disable\-overwrite\fP option is used)
1611 puts the header files in a different subdirectory.
1612 All of the library names have a \*(``w\*('' appended to them,
1630 You must also enable the wide-character features in the header file
1631 when compiling for the wide-character library
1632 to use the extended (wide-character) functions.
1633 The symbol which enables these features has changed since XSI Curses, Issue 4:
1635 Originally, the wide-character feature required the symbol
1636 \fB_XOPEN_SOURCE_EXTENDED\fP
1637 but that was only valid for XPG4 (1996).
1639 Later, that was deemed conflicting with \fB_XOPEN_SOURCE\fP defined to 500.
1642 none of the features in this implementation require a \fB_XOPEN_SOURCE\fP
1643 feature greater than 600.
1644 However, X/Open Curses, Issue 7 (2009) recommends defining it to 700.
1646 Alternatively, you can enable the feature by defining \fBNCURSES_WIDECHAR\fP
1647 with the caveat that some other header file than \fBcurses.h\fP
1648 may require a specific value for \fB_XOPEN_SOURCE\fP
1649 (or a system-specific symbol).
1651 The \fI\%curses.h\fP header file installed for the wide-character
1652 library is designed to be compatible with the non-wide library's header.
1653 Only the size of the \fI\%WINDOW\fP structure differs;
1654 few applications require more than pointers to \fI\%WINDOW\fPs.
1656 If the headers are installed allowing overwrite,
1657 the wide-character library's headers should be installed last,
1658 to allow applications to be built using either library
1659 from the same set of headers.
1663 The configure script renames the library.
1664 All of the library names have a \*(``t\*('' appended to them
1665 (before any \*(``w\*('' added by \fB\-\-enable\-widec\fP).
1667 The global variables such as \fBLINES\fP are replaced by macros to
1668 allow read-only access.
1669 At the same time, setter-functions are provided to set these values.
1670 Some applications (very few) may require changes to work with this convention.
1679 The shared and normal (static) library names differ by their suffixes,
1680 e.g., \fBlibncurses.so\fP and \fBlibncurses.a\fP.
1681 The debug and profiling libraries add a \*(``_g\*(''
1682 and a \*(``_p\*('' to the root names respectively,
1683 e.g., \fBlibncurses_g.a\fP and \fBlibncurses_p.a\fP.
1686 Low-level functions which do not depend upon whether the library
1687 supports wide-characters, are provided in the tinfo library.
1689 By doing this, it is possible to share the tinfo library between
1690 wide/normal configurations as well as reduce the size of the library
1691 when only low-level functions are needed.
1693 Those functions are described in these pages:
1696 \fB\%curs_extend\fP(3X) \- miscellaneous \fIcurses\fP extensions
1698 \fB\%curs_inopts\fP(3X) \- \fIcurses\fP input options
1700 \fB\%curs_kernel\fP(3X) \- low-level \fIcurses\fP routines
1702 \fB\%curs_termattrs\fP(3X) \- \fIcurses\fP environment query routines
1704 \fB\%curs_termcap\fP(3X) \- \fIcurses\fP emulation of \fItermcap\fP
1706 \fB\%curs_terminfo\fP(3X) \- \fIcurses\fP interface to \fIterminfo\fP
1709 \fB\%curs_util\fP(3X) \- miscellaneous \fIcurses\fP utility routines
1713 The \fBtrace\fP function normally resides in the debug library,
1714 but it is sometimes useful to configure this in the shared library.
1715 Configure scripts should check for the function's existence rather
1716 than assuming it is always in the debug library.
1720 tab stop initialization database
1723 compiled terminal capability database
1725 X/Open Curses permits most functions it specifies to be made available
1727 .\" See X/Open Curses Issue 4, Version 2, pp. 227-234.
1728 .\" See X/Open Curses Issue 7, pp. 311-318.
1729 \fI\%ncurses\fP does so
1731 for functions that return values via their parameters,
1733 to support obsolete features,
1737 those that move the cursor before another operation),
1740 a few special cases.
1742 If the standard output file descriptor of an
1744 program is redirected to something that is not a terminal device,
1745 the library writes screen updates to the standard error file descriptor.
1746 This was an undocumented feature of SVr3.
1748 See subsection \*(``Header files\*('' below regarding symbols exposed by
1749 inclusion of \fI\%curses.h\fP.
1752 enables an application to capture mouse events on certain terminals,
1755 see \fB\%curs_mouse\fP(3X).
1758 provides a means of responding to window resizing events,
1759 as when running in a GUI terminal emulator application such as
1761 see \fB\%resizeterm\fP(3X) and \fB\%wresize\fP(3X).
1764 allows an application to query the terminal for the presence of a wide
1765 variety of special keys;
1766 see \fB\%has_key\fP(3X).
1769 extends the fixed set of function key capabilities specified by X/Open
1770 Curses by allowing the application programmer to define additional key
1771 sequences at runtime;
1773 \fB\%define_key\fP(3X),
1774 \fB\%key_defined\fP(3X),
1779 can exploit the capabilities of terminals implementing ISO\ 6429/ECMA-48
1780 SGR\ 39 and SGR\ 49 sequences,
1781 which allow an application to reset the terminal to its original
1782 foreground and background colors.
1783 From a user's perspective,
1784 the application is able to draw colored text on a background whose color
1785 is set independently,
1786 providing better control over color contrasts.
1787 See \fB\%default_colors\fP(3X).
1791 application can choose to hide the internal details of
1794 instead using accessor functions such as
1795 \fB\%is_scrollok\fP(3X).
1798 enables an application to direct application output to a printer
1799 attached to the terminal device;
1800 see \fB\%curs_print\fP(3X).
1803 offers \fB\%slk_attr\fP(3X) as a counterpart of \fB\%attr_get\fP(3X) for
1804 soft-label key lines,
1805 and \fB\%extended_slk_color\fP(3X) as a form of \fB\%slk_color\fP(3X)
1806 that can gather color information from them when many colors are
1809 Some extensions are only available if
1811 is compiled to support them;
1812 section \*(``ALTERNATE CONFIGURATIONS\*('' describes how.
1814 Rudimentary support for multi-threaded applications may be available;
1815 see \fBcurs_threads\fP(3X).
1817 Functions that ease the management of multiple screens can be exposed;
1818 see \fBcurs_sp_funcs\fP(3X).
1820 To aid applications to debug their memory usage,
1822 optionally offers functions to more aggressively free memory it
1823 dynamically allocates itself;
1824 see \fBcurs_memleaks\fP(3X).
1826 The library facilitates auditing and troubleshooting of its behavior;
1827 see \fBcurs_trace\fP(3X).
1831 causes the library to fall back to reading
1833 if the terminal setup code cannot find a
1835 entry corresponding to
1837 Use of this feature is not recommended,
1838 as it essentially includes an entire
1843 at a cost in memory usage and application launch latency.
1851 Individual man pages indicate where this is the case.
1853 X/Open Curses defines two levels of conformance,
1854 \*(``base\*('' and \*(``enhanced\*(''.
1855 The latter includes several additional features,
1856 such as wide-character and color support.
1858 intends base-level conformance with X/Open Curses,
1859 and supports nearly all its enhanced features.
1860 .\" XXX: What's missing? GBR counts untic(1), and that's all.
1862 Differences between X/Open Curses and
1864 are documented in the \*(``PORTABILITY\*('' sections of applicable man
1866 .SS "Error Checking"
1867 In many cases, X/Open Curses is vague about error conditions,
1868 omitting some of the SVr4 documentation.
1870 Unlike other implementations, this one checks parameters such as pointers
1871 to \fI\%WINDOW\fP structures to ensure they are not null.
1872 The main reason for providing this behavior is to guard against programmer
1874 The standard interface does not provide a way for the library
1875 to tell an application which of several possible errors were detected.
1876 Relying on this (or some other) extension will adversely affect the
1877 portability of curses applications.
1878 .SS "Padding Differences"
1879 In historic curses versions, delays embedded in the capabilities \fBcr\fP,
1880 \fBind\fP, \fBcub1\fP, \fBff\fP and \fBtab\fP activated corresponding delay
1881 bits in the Unix tty driver.
1882 In this implementation, all padding is done by sending NUL bytes.
1883 This method is slightly more expensive, but narrows the interface
1884 to the Unix kernel significantly and increases the package's portability
1887 The header file \fI\%curses.h\fP itself includes the header files
1888 \fI\%stdio.h\fP and \fI\%unctrl.h\fP.
1890 X/Open Curses has more to say,
1891 but does not finish the story:
1894 The inclusion of <curses.h> may make visible all symbols
1895 from the headers <stdio.h>, <term.h>, <termios.h>, and <wchar.h>.
1898 Here is a more complete story:
1900 Starting with BSD curses, all implementations have included <stdio.h>.
1902 BSD curses included <curses.h> and <unctrl.h> from an internal header
1905 (\*(``ext\*('' abbreviated \*(``externs\*('').
1907 BSD curses used <stdio.h> internally (for \fBprintw\fP and \fBscanw\fP),
1908 but nothing in <curses.h> itself relied upon <stdio.h>.
1910 SVr2 curses added \fBnewterm\fP(3X), which relies upon <stdio.h>.
1911 That is, the function prototype uses \fBFILE\fP.
1913 SVr4 curses added \fBputwin\fP and \fBgetwin\fP, which also use <stdio.h>.
1915 X/Open Curses documents all three of these functions.
1917 SVr4 curses and X/Open Curses do not require the developer to
1918 include <stdio.h> before including <curses.h>.
1919 Both document curses showing <curses.h> as the only required header.
1921 As a result, standard <curses.h> will always include <stdio.h>.
1923 X/Open Curses is inconsistent with respect to SVr4 regarding <unctrl.h>.
1925 As noted in \fBcurs_util\fP(3X),
1926 \fI\%ncurses\fP includes <unctrl.h> from <curses.h>
1929 X/Open's comments about <term.h> and <termios.h> may refer to HP-UX and AIX:
1931 HP-UX curses includes <term.h> from <curses.h>
1932 to declare \fBsetupterm\fP in curses.h,
1933 but \fI\%ncurses\fP (and Solaris curses) do not.
1935 AIX curses includes <term.h> and <termios.h>.
1936 Again, \fI\%ncurses\fP (and Solaris curses) do not.
1938 X/Open says that <curses.h> \fImay\fP include <term.h>,
1939 but there is no requirement that it do that.
1941 Some programs use functions declared in both <curses.h> and <term.h>,
1942 and must include both headers in the same module.
1943 Very old versions of AIX curses required including <curses.h>
1944 before including <term.h>.
1946 Because \fI\%ncurses\fP header files include the headers needed to
1947 define datatypes used in the headers,
1948 \fI\%ncurses\fP header files can be included in any order.
1949 But for portability, you should include <curses.h> before <term.h>.
1951 X/Open Curses says \fI"may make visible"\fP
1952 because including a header file does not necessarily make all symbols
1953 in it visible (there are ifdef's to consider).
1955 For instance, in \fI\%ncurses\fP <wchar.h> \fImay\fP be included if
1956 the proper symbol is defined, and if \fI\%ncurses\fP is configured for
1957 wide-character support.
1958 If the header is included, its symbols may be made visible.
1959 That depends on the value used for \fB_XOPEN_SOURCE\fP
1962 X/Open Curses documents one required header,
1963 in a special case: <stdarg.h> before <curses.h> to prototype
1964 the \fBvw_printw\fP and \fBvw_scanw\fP functions
1965 (as well as the obsolete
1966 the \fBvwprintw\fP and \fBvwscanw\fP functions).
1967 Each of those uses a \fBva_list\fP parameter.
1969 The two obsolete functions were introduced in SVr3.
1970 The other functions were introduced in X/Open Curses.
1971 In between, SVr4 curses provided for the possibility that
1972 an application might include either <varargs.h> or <stdarg.h>.
1973 Initially, that was done by using \fBvoid*\fP for the \fBva_list\fP
1975 Later, a special type (defined in <stdio.h>) was introduced,
1976 to allow for compiler type-checking.
1977 That special type is always available,
1978 because <stdio.h> is always included by <curses.h>.
1980 None of the X/Open Curses implementations require an application
1981 to include <stdarg.h> before <curses.h> because they either
1982 have allowed for a special type,
1984 (like \fI\%ncurses\fP)
1985 include <stdarg.h> directly to provide a portable interface.
1987 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1988 Based on \fIpcurses\fP by Pavel Curtis.
1990 \fB\%curs_variables\fP(3X),
1991 \fB\%terminfo\fP(5),
1992 \fB\%user_caps\fP(5)