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 TABSIZE is a feature of SVr4 curses which is not documented by X/Open
94 curses.
95
96 · In SVr4 curses, TABSIZE is initially set from the terminal descrip‐
97 tion's init_tabs capability. After that, it can be altered by the
98 applications using SVr4 curses.
99
100 SVr4 curses uses the current value of TABSIZE to compute the posi‐
101 tion of tabstops for updating both the virtual screen with add‐
102 ch(3X) as well as the physical screen with mvcur(3X).
103
104 · This implementation uses the current value of TABSIZE only for up‐
105 dating the virtual screen. It uses the terminal description's it
106 (init_tabs) capability for computing hardware tabs (i.e., tab stops
107 on the physical screen).
108
109 · Other implementations differ. For instance, NetBSD curses allows
110 TABSIZE to be set through an environment variable. This implemen‐
111 tation does not.
112
113 NetBSD curses does not support hardware tabs; it uses the init_tabs
114 capability and the TABSIZE variable only for updating the virtual
115 screen.
116
117 ESCDELAY is an extension in AIX curses:
118
119 · In AIX, the units for ESCDELAY are fifths of a millisecond.
120
121 · The default value for AIX's ESCDELAY is 0.1 seconds.
122
123 · AIX also enforces a limit of 10,000 seconds for ESCDELAY; this im‐
124 plementation currently has no upper limit.
125
126 This implementation has long used ESCDELAY with units of milliseconds,
127 making it impossible to be completely compatible with AIX. Likewise,
128 most users have either decided to override the value, or rely upon its
129 default value.
130
132 curses(3X), curs_opaque(3X), curs_terminfo(3X), curs_threads(3X),
133 term_variables(3X), terminfo(5).
134
135
136
137 curs_variables(3X)