1curs_variables(3X) curs_variables(3X)
2
3
4
6 COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES, TABSIZE, curscr, newscr,
7 stdscr - curses global variables
8
10 #include <curses.h>
11
12 int COLOR_PAIRS;
13 int COLORS;
14 int COLS;
15 int ESCDELAY;
16 int LINES;
17 int TABSIZE;
18 WINDOW * curscr;
19 WINDOW * newscr;
20 WINDOW * stdscr;
21
23 This page summarizes variables provided by the curses library. A more
24 complete description is given in the curses(3X) manual page.
25
26 Depending on the configuration, these may be actual variables, or
27 macros (see curs_threads(3X) and curs_opaque(3X)) which provide read-
28 only access to curses's state. In either case, applications should
29 treat them as read-only to avoid confusing the library.
30
31 COLOR_PAIRS
32 After initializing curses, this variable contains the number of color
33 pairs which the terminal can support. Usually the number of color
34 pairs will be the product COLORS*COLORS, however this is not always
35 true:
36
37 · a few terminals use HLS colors, which do not follow this rule
38
39 · terminals supporting a large number of colors are limited by the
40 number of color pairs that can be represented in a signed short
41 value.
42
43 COLORS
44 After initializing curses, this variable contains the number of colors
45 which the terminal can support.
46
47 COLS
48 After initializing curses, this variable contains the width of the
49 screen, i.e., the number of columns.
50
51 ESCDELAY
52 This variable holds the number of milliseconds to wait after reading an
53 escape character, to distinguish between an individual escape character
54 entered on the keyboard from escape sequences sent by cursor- and func‐
55 tion-keys (see curses(3X)).
56
57 LINES
58 After initializing curses, this variable contains the height of the
59 screen, i.e., the number of lines.
60
61 TABSIZE
62 This variable holds the number of columns used by the curses library
63 when converting a tab character to spaces as it adds the tab to a win‐
64 dow (see curs_addch(3X).
65
66 The Current Screen
67 This implementation of curses uses a special window curscr to record
68 its updates to the terminal screen.
69
70 This is referred to as the “physical screen” in the curs_refresh(3X)
71 and curs_outopts(3X) manual pages.
72
73 The New Screen
74 This implementation of curses uses a special window newscr to hold up‐
75 dates to the terminal screen before applying them to curscr.
76
77 This is referred to as the “virtual screen” in the curs_kernel(3X),
78 curs_refresh(3X) and curs_outopts(3X) manual pages.
79
80 The Standard Screen
81 Upon initializing curses, a default window called stdscr, which is the
82 size of the terminal screen, is created. Many curses functions use
83 this window.
84
86 The curses library is initialized using either initscr(3X), or
87 newterm(3X).
88
89 If curses is configured to use separate curses/terminfo libraries, most
90 of these variables reside in the curses library.
91
93 ESCDELAY and TABSIZE are extensions, not provided in most other imple‐
94 mentations of curses.
95
96 ESCDELAY is an extension in AIX curses:
97
98 · In AIX, the units for ESCDELAY are fifths of a millisecond.
99
100 · The default value for AIX's ESCDELAY is 0.1 seconds.
101
102 · AIX also enforces a limit of 10,000 seconds for ESCDELAY; this im‐
103 plementation currently has no upper limit.
104
105 This implementation has long used ESCDELAY with units of milliseconds,
106 making it impossible to be completely compatible with AIX. Likewise,
107 most users have either decided to override the value, or rely upon its
108 default value.
109
111 curses(3X), curs_opaque(3X), curs_terminfo(3X), curs_threads(3X),
112 term_variables(3X), terminfo(5).
113
114
115
116 curs_variables(3X)