4 The ncurses (new curses) library is a free software emulation of
5 curses in System V Release 4.0, and more. It uses terminfo format,
6 supports pads and color and multiple highlights and forms characters
7 and function-key mapping, and has all the other SYSV-curses
8 enhancements over BSD curses.
10 In mid-June 1995, the maintainer of 4.4BSD curses declared that he
11 considered 4.4BSD curses obsolete, and is encouraging the keepers of
12 Unix releases such as BSD/OS, freeBSD and netBSD to switch over to
15 The ncurses code was developed under GNU/Linux. It should port easily
16 to any ANSI/POSIX-conforming UNIX. It has even been ported to OS/2
19 The distribution includes the library and support utilities, including
20 a terminfo compiler tic(1), a decompiler infocmp(1), clear(1),
21 tput(1), tset(1), and a termcap conversion tool captoinfo(1). Full
22 manual pages are provided for the library and tools.
24 The ncurses distribution is available via anonymous FTP at the GNU
25 distribution site [1]ftp://ftp.gnu.org/pub/gnu/ncurses.
26 It is also available at [2]ftp://dickey.his.com/ncurses.
30 This release is designed to be upward compatible from ncurses 5.0 and
31 5.1; very few applications will require recompilation, depending on
32 the platform. These are the highlights from the change-log since
36 * change type of ospeed variable back to short to match its use in
37 legacy applications. It was altered after ncurses 4.2 to speed_t
38 to repair a type mismatch which was introduced after 1.9.4 in
39 1995. The principal users of termcap continued to use short, which
41 NOTE: A few applications will have to be recompiled (about 1% of
42 the programs in a typical Linux distribution, 10% of the programs
43 that use ncurses). These are easy to identify with nm or strings.
44 * remove a private function _nc_can_clear_with(), which was built
45 with the configure --enable-expanded option but not used.
46 * add several private functions (prefixed with "_nc_") for tracing
47 chtype values in the debug library, and for better access and
48 buffer limit checking.
50 New features and improvements:
51 * rewrote tgoto() to make it better support existing termcap
52 applications which use hardcoded strings rather than obtain all of
53 their information from the termcap file. If the string does not
54 appear to be a terminfo string (i.e., does not refer to a "%p"
55 parameter, or terminfo-style padding), and termcap support is
56 configured, tgoto() will interpret it as termcap. Otherwise, as
57 before, it will use tparm().
58 * to ensure that the tgoto() changes work properly, added checks to
59 tic which report capabilities that do not reference the expected
61 * new configure script options:
62 + option --disable-root-environ adds runtime checks which tell
63 ncurses to disregard $TERMINFO and similar environment
64 variables if the current user is root, or running
66 + option --disable-assumed-color allows you to use the pre-5.1
67 convention of default colors used for color-pair 0 to be
68 configured (see assume_default_colors()).
69 + implement configure script options that transform installed
70 program names, e.g., --program-prefix, including the manpage
71 names and cross references.
72 + option --with-database allows you to specify a different
73 terminfo source-file to install. On OS/2 EMX, the default is
74 misc/emx.src, otherwise misc/terminfo.src
75 + option --with-default-terminfo-dir allows you to specify the
76 default terminfo database directory.
77 + option --with-libtool allows you to build with libtool.
78 NOTE: libtool uses a different notation for numbering shared
79 library versions from the existing ncurses configuration.
80 + option --with-manpage-tbl causes the manpages to be
81 preprocessed by tbl(1) prior to installation,
82 + option --without-curses-h causes the installation process to
83 install curses.h as ncurses.h and make appropriate changes to
85 * modified configure script options:
86 + change symbol used by the --install-prefix configure option
87 from INSTALL_PREFIX to DESTDIR (the latter has become common
88 usage although the name is misleading).
89 + modify ld -rpath options (e.g., Linux, and Solaris) to use an
90 absolute pathname for the build tree's lib directory,
91 avoiding confusion with directories relative to the current
92 one with the installed programs.
93 + modified misc/run_tic.in to use tic -o, to eliminate
94 dependency on $TERMINFO variable for installs.
96 + updated xterm terminfo entries to match XFree86 xterm patch
98 + added amiga-vnc, Matrix Orbital, and QNX qansi to
100 + added os2 entry to misc/emx.src.
101 + add S0 and E0 extensions to screen's terminfo entry since
102 otherwise the FreeBSD port makes it pass termcap equivalents
103 to tgoto, which would be misinterpreted by older versions of
105 * improvements to program usability:
106 + modify programs to use curses_version() string to report the
107 version of ncurses with which they are compiled rather than
108 the NCURSES_VERSION string. The function returns the patch
109 level in addition to the major and minor version numbers.
110 + modify tput program so it can be renamed or invoked via a
111 link as 'reset' or 'init', producing the same effect as
112 tput reset or tput init.
113 + add error checking to infocmp's -v and -m options to ensure
114 that the option value is indeed a number.
115 * improved performance:
116 + replace a lookup table in lib_vidattr.c used to decode
117 no_color_video with a logic expression which is faster.
120 * correct manlinks.sed script introduced in ncurses 5.1 to avoid
121 using ERE "\+", which is not understood by standard versions of
122 sed. This happens to work with GNU sed, but is not portable, and
123 was the initial motivation for this release.
124 * remove "hpux10.*" case from CF_SHARED_OPTS configure script macro.
125 This differed from the "hpux*" case by using reversed symbolic
126 links, which made the 5.1 version not match the configuration of
127 5.0 shared libraries.
128 * guard against corrupt terminfo data:
129 + modify tparm() to disallow arithmetic on strings, analyze the
130 varargs list to read strings as strings and numbers as
132 + modify tparm()'s internal function spop() to treat a null
133 pointer as an empty string.
134 + modify parse_format() in lib_tparm.c to ignore precision if
135 it is longer than 10000.
136 + rewrote limit checks in lib_mvcur.c using new functions
137 _nc_safe_strcat(), etc. Made other related changes to check
138 lengths used for strcat() and strcpy().
139 * corrections to screen optimization:
140 + added special case in lib_vidattr.c to reset underline and
141 standout for devices that have no sgr0 defined.
142 + change handling of non_dest_scroll_region in tty_update.c to
143 clear text after it is shifted in rather than before shifting
144 out. Also correct row computation.
145 + modify rs2 capability in xterm-r6 and similar entries where
146 cursor save/restore bracketed the sequence for resetting
147 video attributes. The cursor restore would undo that.
149 + when checking LC_ALL, LC_CTYPE, and LANG environment
150 variables for UTF-8 locale, ignore those which are set to an
151 empty value, as per SUSV2.
152 + encode 0xFFFD in UTF-8 with 3 bytes, not 2.
153 + modify _nc_utf8_outch() to avoid sign-extension when checking
154 for out-of-range value.
155 * other library fixes:
156 + added checks for an empty $HOME environment variable, to
157 avoid retrieving terminfo descriptions from ./.terminfo .
158 + change functions _nc_parse_entry() and postprocess_termcap()
159 to avoid using strtok(), because it is non-reentrant.
160 + initialize fds[] array to 0's in _nc_timed_wait(); apparently
161 poll() only sets the revents members of that array when there
162 is activity corresponding to the related file.
163 + add a check for null pointer in Make_Enum_Type().
164 + fix a heap problem with the c++ binding.
165 + correct missing includes for <string.h> in several places,
166 including the C++ binding. This is not noted by gcc unless we
167 use the -fno-builtin option.
168 * several fixes for tic:
169 + add a check for empty buffers returned by fgets() in
170 comp_scan.c next_char() function, in case tic is run on a
171 non-text file (fixes a core dump).
172 + modify tic to verify that its inputs are really files, in
173 case someone tries to read a directory (or /dev/zero).
174 + correct an uninitialized parameter to open_tempfile() in
175 tic.c which made "tic -I" give an ambiguous error message
177 + correct logic in adjust_cancels(), which did not check both
178 alternatives when reclassifying an extended name between
179 boolean, number and string, causing an infinite loop in tic.
180 * using new checks in tic for parameter counts in capability
181 strings, found/fixed several errors both in the terminfo database
182 and in the include/Caps file.
183 + modified several terminfo capability strings, including the
184 definitions for setaf, setab, in include/Caps to indicate
185 that the entries are parameterized. This information is used
186 to tell which strings are translated when converting to
187 termcap. This fixes a problem where the generated termcap
188 would contain a spurious "%p1" for the terminfo "%p1%d".
189 + correct parameter counts in include/Caps for dclk as well as
190 some printer-specific capabilities: csnm, defc, scs, scsd,
192 * various fixes for install scripts used to support configure
193 --srcdir and --with-install-prefix.
194 * correct several mismatches between manpage filename and ".TH"
195 directives, renaming dft_fgbg.3x to default_colors.3x and
196 menu_attribs.3x to menu_attributes.3x.
200 + newer config.guess, config.sub, including changes to support
201 OS/2 EMX. The configure script for OS/2 EMX still relies on a
202 patch since there is no (working) support for that platform
203 in the main autoconf distribution.
204 + make configure script checks on variables $GCC and $GXX
205 consistently compare against 'yes' rather than test if they
206 are nonnull, since either may be set to the corresponding
207 name of the C or C++ compiler.
208 + change configure script to use AC_CANONICAL_SYSTEM rather
209 than AC_CANONICAL_HOST, which means that configure --target
210 will set a default program-prefix.
211 + modify the check for big-core to force a couple of memory
212 accesses, which may work as needed for older/less-capable
213 machines (if not, there's still the explicit configure
215 + modify configure test for tcgetattr() to allow for old
216 implementations, e.g., on BeOS, which only defined it as a
218 + add configure check for filesystems (such as OS/2 EMX) which
219 do not distinguish between upper/lowercase filenames, use
220 this to fix tags rules in makefiles.
221 + add MKncurses_def.sh to generate fallback definitions for
222 ncurses_cfg.h, to quiet gcc -Wundef warnings, modified
223 ifdef's in code to consistently use "#if" rather than
225 + change most remaining unquoted parameters of test in
226 configure script to use quotes, for instance fixing a problem
227 in the --disable-database option.
228 + modify scripts so that "make install.data" works on OS/2 EMX.
229 + modify scripts and makefiles so the Ada95 directory builds on
232 + replaced case-statement in _nc_tracebits() for CSIZE with a
233 table to simplify working around implementations that define
234 random combinations of the related macros to zero.
235 + improved OS/2 mouse support by retrying as a 2-button mouse
236 if code fails to set up a 3-button mouse.
237 + added private entrypoint _nc_basename(), used to consolidate
238 related code in progs, as well as accommodating OS/2 EMX
240 + alter definition of NCURSES_CONST to make it non-empty.
241 + redefine 'TEXT' in menu.h for AMIGA, since it is reported to
242 have an (unspecified) symbol conflict.
244 + modified progs/tset.c and tack/sysdep.c to build with sgttyb
245 interface if neither termio or termios is available. Tested
246 this with FreeBSD 2.1.5 (which does have termios - but the
251 The ncurses package is fully compatible with SVr4 (System V Release 4)
253 * All 257 of the SVr4 calls have been implemented (and are
255 * Full support for SVr4 curses features including keyboard mapping,
256 color, forms-drawing with ACS characters, and automatic
257 recognition of keypad and function keys.
258 * An emulation of the SVr4 panels library, supporting a stack of
259 windows with backing store, is included.
260 * An emulation of the SVr4 menus library, supporting a uniform but
261 flexible interface for menu programming, is included.
262 * An emulation of the SVr4 form library, supporting data collection
263 through on-screen forms, is included.
264 * Binary terminfo entries generated by the ncurses tic(1)
265 implementation are bit-for-bit-compatible with the entry format
267 * The utilities have options to allow you to filter terminfo entries
268 for use with less capable curses/terminfo versions such as the
271 The ncurses package also has many useful extensions over SVr4:
272 * The API is 8-bit clean and base-level conformant with the X/OPEN
273 curses specification, XSI curses (that is, it implements all BASE
274 level features, but not all EXTENDED features). Most
275 EXTENDED-level features not directly concerned with wide-character
276 support are implemented, including many function calls not
277 supported under SVr4 curses (but portability of all calls is
278 documented so you can use the SVr4 subset only).
279 * Unlike SVr3 curses, ncurses can write to the rightmost-bottommost
280 corner of the screen if your terminal has an insert-character
282 * Ada95 and C++ bindings.
283 * Support for mouse event reporting with X Window xterm and OS/2
285 * Extended mouse support via Alessandro Rubini's gpm package.
286 * The function wresize() allows you to resize windows, preserving
288 * The function use_default_colors() allows you to use the terminal's
289 default colors for the default color pair, achieving the effect of
291 * The functions keyok() and define_key() allow you to better control
292 the use of function keys, e.g., disabling the ncurses KEY_MOUSE,
293 or by defining more than one control sequence to map to a given
295 * Support for 16-color terminals, such as aixterm and XFree86 xterm.
296 * Better cursor-movement optimization. The package now features a
297 cursor-local-movement computation more efficient than either BSD's
299 * Super hardware scrolling support. The screen-update code
300 incorporates a novel, simple, and cheap algorithm that enables it
301 to make optimal use of hardware scrolling, line-insertion, and
302 line-deletion for screen-line movements. This algorithm is more
303 powerful than the 4.4BSD curses quickch() routine.
304 * Real support for terminals with the magic-cookie glitch. The
305 screen-update code will refrain from drawing a highlight if the
306 magic- cookie unattributed spaces required just before the
307 beginning and after the end would step on a non-space character.
308 It will automatically shift highlight boundaries when doing so
309 would make it possible to draw the highlight without changing the
310 visual appearance of the screen.
311 * It is possible to generate the library with a list of pre-loaded
312 fallback entries linked to it so that it can serve those terminal
313 types even when no terminfo tree or termcap file is accessible
314 (this may be useful for support of screen-oriented programs that
315 must run in single-user mode).
316 * The tic(1)/captoinfo utility provided with ncurses has the ability
317 to translate many termcaps from the XENIX, IBM and AT&T extension
319 * A BSD-like tset(1) utility is provided.
320 * The ncurses library and utilities will automatically read terminfo
321 entries from $HOME/.terminfo if it exists, and compile to that
322 directory if it exists and the user has no write access to the
323 system directory. This feature makes it easier for users to have
324 personal terminfo entries without giving up access to the system
326 * You may specify a path of directories to search for compiled
327 descriptions with the environment variable TERMINFO_DIRS (this
328 generalizes the feature provided by TERMINFO under stock System
330 * In terminfo source files, use capabilities may refer not just to
331 other entries in the same source file (as in System V) but also to
332 compiled entries in either the system terminfo directory or the
333 user's $HOME/.terminfo directory.
334 * A script (capconvert) is provided to help BSD users transition
335 from termcap to terminfo. It gathers the information in a TERMCAP
336 environment variable and/or a ~/.termcap local entries file and
337 converts it to an equivalent local terminfo tree under
339 * Automatic fallback to the /etc/termcap file can be compiled in
340 when it is not possible to build a terminfo tree. This feature is
341 neither fast nor cheap, you don't want to use it unless you have
343 * The table-of-entries utility toe makes it easy for users to see
344 exactly what terminal types are available on the system.
345 * The library meets the XSI requirement that every macro entry point
346 have a corresponding function which may be linked (and will be
347 prototype-checked) if the macro definition is disabled with
349 * An HTML "Introduction to Programming with NCURSES" document
350 provides a narrative introduction to the curses programming
355 Numerous bugs present in earlier versions have been fixed; the library
356 is far more reliable than it used to be. Bounds checking in many
357 `dangerous' entry points has been improved. The code is now type-safe
358 according to gcc -Wall. The library has been checked for malloc leaks
359 and arena corruption by the Purify memory-allocation tester.
361 The ncurses code has been tested with a wide variety of applications
362 including (versions starting with those noted):
365 Curses Development Kit
366 [3]http://www.vexus.ca/CDK.html
367 [4]http://dickey.his.com/cdk.
371 [5]http://dickey.his.com/ded.
374 the underlying application used in Slackware's setup, and the
375 basis for similar applications on GNU/Linux.
376 [6]http://dickey.his.com/dialog.
379 the character-screen WWW browser
380 [7]http://lynx.isc.org/release.
382 Midnight Commander 4.1
384 [8]www.gnome.org/mc/.
388 [9]http://www.mutt.org.
391 file-transfer utility
392 [10]http://www.ncftp.com.
395 New vi versions 1.50 are able to use ncurses versions 1.9.7 and
397 [11]http://www.bostic.com/vi/.
400 newsreader, supporting color, MIME
401 [12]http://www.tin.org.
405 [13]http://members.iinet.net.au/~yusuf/taper/.
408 Volks-Hypertext browser for the Jargon File
409 [14]http://www.bg.debian.org/Packages/unstable/text/vh.html.
411 as well as some that use ncurses for the terminfo support alone:
415 [15]http://www.pp.clinet.fi/~walker/minicom.html.
419 [16]http://dickey.his.com/vile.
421 The ncurses distribution includes a selection of test programs
422 (including a few games).
424 Who's Who and What's What
426 The original developers of ncurses are [17]Zeyd Ben-Halim and [18]Eric
427 S. Raymond. Ongoing work is being done by [19]Thomas Dickey and
428 [20]Jürgen Pfeifer. [21]Thomas Dickey acts as the maintainer for the
429 Free Software Foundation, which holds the copyright on ncurses.
430 Contact the current maintainers at [22]bug-ncurses@gnu.org.
432 To join the ncurses mailing list, please write email to
433 bug-ncurses-request@gnu.org containing the line:
434 subscribe <name>@<host.domain>
436 This list is open to anyone interested in helping with the development
437 and testing of this package.
439 Beta versions of ncurses and patches to the current release are made
440 available at [23]ftp://dickey.his.com/ncurses.
444 * Extended-level XPG4 conformance, with internationalization
446 * Ports to more systems, including DOS and Windows.
448 We need people to help with these projects. If you are interested in
449 working on them, please join the ncurses list.
451 Other Related Resources
453 The distribution includes and uses a version of the terminfo-format
454 terminal description file maintained by Eric Raymond.
455 [24]http://earthspace.net/~esr/terminfo.
457 You can find lots of information on terminal-related topics not
458 covered in the terminfo file at [25]Richard Shuford's archive.
462 1. ftp://ftp.gnu.org/pub/gnu/ncurses
463 2. ftp://dickey.his.com/ncurses
464 3. http://www.vexus.ca/CDK.html
465 4. http://dickey.his.com/cdk/cdk.html
466 5. http://dickey.his.com/ded/ded.html
467 6. http://dickey.his.com/dialog/dialog.html
468 7. http://lynx.isc.org/release/
469 8. file://localhost/usr/build/ncurses/ncurses-5.2-20001021/doc/html/www.gnome.org/mc/
470 9. http://www.mutt.org/
471 10. http://www.ncftp.com/
472 11. http://www.bostic.com/vi/
473 12. http://www.tin.org/
474 13. http://members.iinet.net.au/~yusuf/taper/
475 14. http://www.bg.debian.org/Packages/unstable/text/vh.html
476 15. http://www.pp.clinet.fi/~walker/minicom.html
477 16. http://dickey.his.com/vile/vile.html
478 17. mailto:zmbenhal@netcom.com
479 18. http://www.ccil.org/~esr/home.html
480 19. mailto:dickey@herndon4.his.com
481 20. mailto:juergen.pfeifer@gmx.net
482 21. mailto:dickey@herndon4.his.com
483 22. mailto:bug-ncurses@gnu.org
484 23. ftp://dickey.his.com/ncurses
485 24. http://earthspace.net/~esr/terminfo
486 25. http://www.cs.utk.edu/~shuford/terminal_index.html