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 The New Screen
71 This implementation of curses uses a special window newscr to hold up‐
72 dates to the terminal screen before applying them to curscr.
73
74 The Standard Screen
75 Upon initializing curses, a default window called stdscr, which is the
76 size of the terminal screen, is created. Many curses functions use
77 this window.
78
80 The curses library is initialized using either initscr(3X), or
81 newterm(3X).
82
83 If curses is configured to use separate curses/terminfo libraries, most
84 of these variables reside in the curses library.
85
87 ESCDELAY and TABSIZE are extensions, not provided in most other imple‐
88 mentations of curses.
89
90 ESCDELAY is an extension in AIX curses:
91
92 · In AIX, the units for ESCDELAY are fifths of a millisecond.
93
94 · The default value for AIX's ESCDELAY is 0.1 seconds.
95
96 · AIX also enforces a limit of 10,000 seconds for ESCDELAY; this im‐
97 plementation currently has no upper limit.
98
99 This implementation has long used ESCDELAY with units of milliseconds,
100 making it impossible to be completely compatible with AIX. Likewise,
101 most users have either decided to override the value, or rely upon its
102 default value.
103
105 curses(3X), curs_opaque(3X), curs_terminfo(3X), curs_threads(3X),
106 term_variables(3X), terminfo(5).
107
108
109
110 curs_variables(3X)