3 The ncurses (new curses) library is a free software emulation of
4 curses in System V Release 4.0, and more. It uses terminfo format,
5 supports pads and color and multiple highlights and forms characters
6 and function-key mapping, and has all the other SYSV-curses
7 enhancements over BSD curses.
9 In mid-June 1995, the maintainer of 4.4BSD curses declared that he
10 considered 4.4BSD curses obsolete, and encouraged the keepers of Unix
11 releases such as BSD/OS, FreeBSD and NetBSD to switch over to ncurses.
13 The ncurses code was developed under GNU/Linux. It has been in use for
14 some time with OpenBSD as the system curses library, and on FreeBSD
15 and NetBSD as an external package. It should port easily to any
16 ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp!
18 The distribution includes the library and support utilities, including
19 a terminfo compiler tic(1), a decompiler infocmp(1), clear(1),
20 tput(1), tset(1), and a termcap conversion tool captoinfo(1). Full
21 manual pages are provided for the library and tools.
23 The ncurses distribution is available via anonymous FTP at the GNU
24 distribution site [1]ftp://ftp.gnu.org/gnu/ncurses/ .
25 It is also available at [2]ftp://invisible-island.net/ncurses/ .
29 This release is designed to be upward compatible from ncurses 5.0
30 through 5.7; very few applications will require recompilation,
31 depending on the platform. These are the highlights from the
32 change-log since ncurses 5.7 release.
36 * turn on _XOPEN_CURSES definition in curses.h.
37 * change _nc_has_mouse to has_mouse, reflect its use in C++ and
39 * add is_pad and is_subwin functions for opaque access to the WINDOW
41 * add tiparm, based on review of X/Open Curses Issue 7.
43 New features and improvements
47 * add a terminal driver for Windows console, which supports a MinGW
49 * add extended functions which specify the SCREEN pointer for
50 several curses functions which use the global SP.
51 * improve the NCURSES_NO_UTF8_ACS feature by adding a check for an
52 extended terminfo capability U8.
53 * improve performance of tigetstr, etc., by using hashing code from
55 * add WACS_xxx definitions to wide-character configuration for
56 thick- and double-lines.
57 * modify init_pair to allow caller to create extra color pairs
58 beyond the color_pairs limit, which use default colors.
60 Improvements to Programs
63 * modify tic's -I/-C dump to reformat acsc strings into canonical
64 form (sorted, unique mapping).
65 * add checks in tic for inconsistent cursor-movement controls, and
66 for inconsistent printer-controls.
67 * add special case to _nc_infotocap (used by tic and infocmp) to
68 recognize the setaf/setab strings from xterm+256color and
69 xterm+88color, and provide a reduced version which works with
75 + bterm terminfo entry, based on bogl 0.1.18
79 + mlterm+256color entry, for mlterm 3.0.0
80 + several screen-bce.xxx entries
81 + screen.Eterm terminfo entry
83 + xterm-utf8 entry as a demo of the U8 feature
84 * updated/improved entries:
85 + use extended capabilities:
86 o add U8 feature to denote entries for terminal emulators
87 which do not support VT100 SI/SO when processing UTF-8
89 o add XT capability to entries for terminals that support
90 both xterm-style mouse- and title-controls, for screen
91 which special-cases TERM beginning with xterm or rxvt
92 + improvements based on new checks in tic:
94 o fill in no-parameter forms of cursor-movement where a
95 parameterized form is available
96 o fill in missing cursor controls where the form of the
98 o add parameterized cursor-controls to linux-basic
99 o modify nsterm, xnuppc and tek4115 to make sgr/sgr0
101 o change several terminfo entries to make consistent use
102 of ANSI clear-all-tabs
103 + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48,
104 moving function key definitions from emx-base for
106 + correct missing final 'p' in pfkey capability of
108 + rename atari and st52 terminfo entries to atari-old,
109 st52-old, use newer entries from FreeMiNT.
110 + repurpose gnome terminfo entries as vte, retaining gnome
111 variants for compatibility, but generally deprecating those
112 since the VTE library is what actually defines the behavior
113 of "gnome", etc., since 2003.
114 + improve interix smso terminfo capability by using reverse
116 + correct initc capability of linux-c-nc end-of-range, make
117 similar change for dg+ccc and dgunix+ccc.
118 + update minix terminfo entry.
119 + updated nsterm* entries.
120 + remove unnecessary kcan assignment to ^C from putty.
121 + suppress ncv in screen and konsole-base entries, allowing
123 + change ncv and op capabilities in sun-color terminfo entry to
124 match Sun's entry for this.
125 + fix typo in rmso for tek4106 entry.
126 + improve acsc string for vt52, show arrow keys.
127 + add hard-reset for rs2 to wsvt25 to help ensure that reset
128 ends the alternate character set.
129 + add ccc and initc capabilities to xterm-16color.
134 + wide character support
135 o modify length returned by getcchar to count the trailing
136 null which is documented in X/Open.
137 o fix an infinite recursion when adding a legacy-coding
138 8-bit value using insch.
139 o improve a workaround in adding wide-characters, when a
140 control character is found. The library uses unctrl to
141 obtain a printable version of the control character, but
142 was not passing color or video attributes.
143 o modify waddch_literal, updating line-pointer after a
144 multicolumn character is found to not fit on the current
145 row, and wrapping is done. Since the line-pointer was
146 not updated, the wrapped multicolumn character was
147 written to the beginning of the current row.
148 o fixes in wins_nwstr and related functions to ensure that
149 special characters, i.e., control characters are handled
150 properly with the wide-character configuration.
151 o correct internal _nc_insert_ch to use _nc_insert_wch
152 when inserting wide characters, since the wins_wch
153 function that it used did not update the cursor
156 o add check if Gpm_Open returns a -2, e.g., for "xterm".
157 This is normally suppressed but can be overridden using
158 $NCURSES_GPM_TERMS. Ensure that Gpm_Close is called in
160 o add check in mouse-driver to disable connection if GPM
161 returns a zero, indicating that the connection is
163 o modify getmouse to act as its documentation implied,
164 returning on each call the preceding event until none
165 are left. When no more events remain, it will return
168 o improve handling of color-pairs embedded in attributes
169 for the extended-colors configuration.
170 o add check for failure to open hashed-database needed for
172 o modify use of $CC environment variable which is defined
173 by X/Open as a curses feature, to ignore it if it is not
175 o modify declaration of cur_term when broken-linker is
176 used, but enable-reentrant is not, to match pre-5.7.
177 o correct limit-checks in derwin.
178 o remove old check in mvderwin which prevented moving a
179 derived window whose origin happened to coincide with
181 o correct limit-checks in newwin, to ensure that windows
183 o modify set_curterm to make broken-linker configuration
184 work with changes from 20090228.
185 o modify wgetch to ensure it checks SIGWINCH when it gets
186 an error in non-blocking mode.
187 o correct limit-check in wredrawln, accounting for
189 o fix a null-pointer check in _nc_format_slks in
190 lib_slk.c, from 20070704 changes.
191 o correct translation of "^" in _nc_infotocap, used to
192 transform terminfo to termcap strings.
193 o modify _nc_wgetch to check for a -1 in the fifo, e.g.,
194 after a SIGWINCH, and discard that value, to avoid
195 confusing application.
197 + correct transfer of multicolumn characters in multirow
198 field_buffer, which stopped at the end of the first row due
199 to filling of unused entries in a cchar_t array with nulls.
200 + correct buffer-size after internal resizing of wide-character
201 set_field_buffer, broken in 20081018 changes.
202 + correct layout of working window used to extract data in
203 wide-character configured by set_field_buffer
210 --disable-libtool-version
211 use the "-version-number" feature which was added
212 in libtool 1.5. The default value for the option
213 uses the newer feature, which makes libraries
214 generated using libtool compatible with the
215 standard builds of ncurses.
218 disable a feature which adds rpath options for
219 libraries in unusual places.
222 integrate changes for generic/interop support to
226 generate ".pc" files for each of the libraries, and
227 install them in pkg-config's library directory.
229 --enable-pthreads-eintr
230 control whether to allow EINTR to interrupt a read
231 operation in wgetch. This applies only to the
232 pthread configuration
235 compile-in support for extended functions which
236 accept a SCREEN pointer, reducing the need for
237 juggling the global SP value with set_term and
241 compile with terminal-driver. That is used in the
242 MinGW port, and (being somewhat more complicated)
243 is an experimental alternative to the conventional
244 termlib internals. Currently, it requires the
245 sp-funcs feature to be enabled.
247 --with-ncurses-wrap-prefix
248 allows setting the prefix for functions used to
249 wrap global variables to something other than
252 --with-pkg-config=[DIR]
253 check for pkg-config, optionally specifying its
257 tells the configure script to suppress the install
258 of ncurses' manpages.
261 suppress building test programs.
264 o correct logic for --with-database, which was coded as an
266 o omit the opaque-functions from lib_gen.o when
267 --disable-ext-funcs is used.
270 o modify adacurses-config to look for ".ali" files in the
272 o correct install for the Ada95 tree, which omitted
273 libAdaCurses.a used in adacurses-config.
274 o change install for adacurses-config to provide
275 additional flavors such as adacursesw-config, for
277 o modify scripts to generate ncurses*-config and pc-files
278 to add dependency for tinfo library.
279 o use ncurses*-config scripts if available for
281 o correct name for termlib in ncurses*-config, e.g., if it
282 is renamed to provide a single file for ncurses/ncursesw
284 o generate manpages for the *-config scripts, adapted from
286 o modify install-rule for manpages so that *-config
287 manpages will install when building with --srcdir.
288 o build-fixes for OpenSolaris aka Solaris 11, for
289 wide-character configuration as well as for rpath
290 feature in *-config scripts.
291 o use $includedir symbol in misc/ncurses-config.in, add
293 o improve install-rules for pc-files.
294 o create the pkg-config library directory if needed.
295 o fix typo "==" where "=" is needed in ncurses-config.in
296 and gen-pkgconfig.in files.
297 o modify gen-pkgconfig.in to eliminate a dependency on
298 rpath when deciding whether to add $LIBS to --libs
299 output; that should be shown for the ncurses and tinfo
300 libraries without taking rpath into account.
301 o modify handling of $PKG_CONFIG_LIBDIR to use only the
302 first item in a possibly colon-separated list.
303 + other packaging issues
304 o add make-tar.sh scripts to Ada95 and test subdirectories
305 to help with making those separately distributable.
306 o add Ada95/configure script, to use in tar-file created
307 by Ada95/make-tar.sh.
308 o remove tar-copy.sh and related configure/Makefile
309 chunks, since the Ada95 binding is now installed using
312 + improve configure checks for location of tic and infocmp
313 programs used for installing database and for generating
314 fallback data, e.g., for cross-compiling.
315 + modify #define's for build-compiler to suppress cchar_t
316 symbol from compile of make_hash and make_keys, improving
317 cross-compilation of ncursesw.
318 + simplify include-dependencies of make_hash and make_keys, to
319 reduce the need for setting BUILD_CPPFLAGS in cross-compiling
320 when the build- and target-machines differ.
321 + correct cross-compiling configure check for CF_MKSTEMP macro,
322 by adding a check cache variable set by AC_CHECK_FUNC.
323 * library dependencies:
324 + revise wadd_wch and wecho_wchar to eliminate dependency on
326 + adjust configure script so that "t" is not added to library
327 suffix when weak-symbols are used, allowing the pthread
328 configuration to more closely match the non-thread naming.
329 * building the Ada95 tree:
330 + changes to use gnatmake project files in the Ada95 tree.
331 + add/use configure check to turn on project rules for
333 + old gnatmake (3.15) does not produce libraries using
334 project-file; work around by adding script to generate
336 + add configure --with-ada-sharedlib option, for the test_make
338 + move Ada95-related logic into aclocal.m4, since additional
339 checks will be needed to distinguish old/new implementations
341 + add test_make / test_clean / test_install rules in Ada95/src
342 + change install-path for adainclude directory to
343 /usr/share/ada (was /usr/lib/ada).
344 * other configure/build issues:
345 + make CCHARW_MAX value configurable, noting that changing this
346 would change the size of cchar_t, and would be
348 + improve comparison of program-names when checking for linked
349 flavors such as "reset" by ignoring the executable suffix.
350 + drop mkdirs.sh, use "mkdir -p".
351 + drop misc/ncu-indent and misc/jpf-indent; they are provided
352 by an external package [3]cindent.
353 + change makefiles to use $ARFLAGS rather than $AR_OPTS,
354 provide a configure check to detect whether a "-" is needed
356 + modify CF_DISABLE_LEAKS configure macro so that the
357 --enable-leaks option is not the same as --disable-leaks.
358 + improve configure script macros CF_HEADER_PATH and
359 CF_LIBRARY_PATH by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS
360 values to the search-lists.
361 + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS
362 to work with gcc 4.x's c89 alias, which gives warning
363 messages for cases where older versions would produce an
365 + modify CF_WITH_LIBTOOL configure check to allow unreleased
366 libtool version numbers (e.g. which include alphabetic chars,
367 as well as digits, after the final '.').
368 + improve use of symbolic links in makefiles by using "-f"
369 option if it is supported, to eliminate temporary removal of
371 + add a configure-time check to pick a suitable value for
372 CC_SHARED_OPTS for Solaris.
373 + add -shared option to MK_SHARED_LIB when -Bsharable is used,
374 for *BSD's, without which "main" might be one of the shared
375 library's dependencies.
376 + modify configure script to allow building shared libraries
377 with gcc on AIX 5 or 6.
378 + suppress configure check for static/dynamic linker flags for
379 gcc on Solaris 10, since gcc is confused by absence of static
380 libc, and does not switch back to dynamic mode before
381 finishing the libraries.
382 + suppress configure check for static/dynamic linker flags for
384 + modify misc/run_tic.in to create parent directory, in case
385 this is a new install of hashed database.
386 + modify configure check for tic program, used for fallbacks,
387 to a warning if not found. This makes it simpler to use
388 additonal scripts to bootstrap the fallbacks code using tic
391 + add test/demo_terminfo, for comparison with demo_termcap.
392 + improve test/ncurses.c 'F' test, show combining characters in
394 + fix logic for 'V' in test/ncurses.c tests f/F.
395 + improve test/ncurses.c 'a test to put mouse droppings in the
397 + modify ncurses 'F' test to demo wborder_set with colored
399 + modify ncurses 'f' test to demo wborder with colored lines.
400 + improve test/ncurses.c 'a' test, using unctrl more
401 consistently to display meta-characters.
402 + correct use of key_name in test/ncurses.c 'A' test, which
403 only displays wide-characters, not key-codes since 20070612.
404 + add test/clip_printw.c to illustrate how to use printw
406 + modify test-programs, e.g,. test/view.c, to address subtle
407 differences between Tru64/Solaris and HPUX/AIX getcchar
409 + add some test programs (and make these use the same special
410 keys by sharing linedata.h functions): test/test_addstr.c
411 test/test_addwstr.c test/test_addchstr.c
412 test/test_add_wchstr.c
413 + add test/xterm-256color.dat
414 + modify test programs to allow them to be built with NetBSD
416 + fixes for test programs to build/work on HPUX and AIX, etc.
420 The ncurses package is fully compatible with SVr4 (System V Release 4)
422 * All 257 of the SVr4 calls have been implemented (and are
424 * Full support for SVr4 curses features including keyboard mapping,
425 color, forms-drawing with ACS characters, and automatic
426 recognition of keypad and function keys.
427 * An emulation of the SVr4 panels library, supporting a stack of
428 windows with backing store, is included.
429 * An emulation of the SVr4 menus library, supporting a uniform but
430 flexible interface for menu programming, is included.
431 * An emulation of the SVr4 form library, supporting data collection
432 through on-screen forms, is included.
433 * Binary terminfo entries generated by the ncurses tic(1)
434 implementation are bit-for-bit-compatible with the entry format
436 * The utilities have options to allow you to filter terminfo entries
437 for use with less capable curses/terminfo versions such as the
440 The ncurses package also has many useful extensions over SVr4:
441 * The API is 8-bit clean and base-level conformant with the X/OPEN
442 curses specification, XSI curses (that is, it implements all BASE
443 level features, and most EXTENDED features). It includes many
444 function calls not supported under SVr4 curses (but portability of
445 all calls is documented so you can use the SVr4 subset only).
446 * Unlike SVr3 curses, ncurses can write to the rightmost-bottommost
447 corner of the screen if your terminal has an insert-character
449 * Ada95 and C++ bindings.
450 * Support for mouse event reporting with X Window xterm and FreeBSD
451 and OS/2 console windows.
452 * Extended mouse support via Alessandro Rubini's gpm package.
453 * The function wresize allows you to resize windows, preserving
455 * The function use_default_colors allows you to use the terminal's
456 default colors for the default color pair, achieving the effect of
458 * The functions keyok and define_key allow you to better control the
459 use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by
460 defining more than one control sequence to map to a given key
462 * Support for 256-color terminals, such as modern xterm, when
463 configured using the --enable-ext-colors option.
464 * Support for 16-color terminals, such as aixterm and modern xterm.
465 * Better cursor-movement optimization. The package now features a
466 cursor-local-movement computation more efficient than either BSD's
468 * Super hardware scrolling support. The screen-update code
469 incorporates a novel, simple, and cheap algorithm that enables it
470 to make optimal use of hardware scrolling, line-insertion, and
471 line-deletion for screen-line movements. This algorithm is more
472 powerful than the 4.4BSD curses quickch routine.
473 * Real support for terminals with the magic-cookie glitch. The
474 screen-update code will refrain from drawing a highlight if the
475 magic- cookie unattributed spaces required just before the
476 beginning and after the end would step on a non-space character.
477 It will automatically shift highlight boundaries when doing so
478 would make it possible to draw the highlight without changing the
479 visual appearance of the screen.
480 * It is possible to generate the library with a list of pre-loaded
481 fallback entries linked to it so that it can serve those terminal
482 types even when no terminfo tree or termcap file is accessible
483 (this may be useful for support of screen-oriented programs that
484 must run in single-user mode).
485 * The tic(1)/captoinfo utility provided with ncurses has the ability
486 to translate many termcaps from the XENIX, IBM and AT&T extension
488 * A BSD-like tset(1) utility is provided.
489 * The ncurses library and utilities will automatically read terminfo
490 entries from $HOME/.terminfo if it exists, and compile to that
491 directory if it exists and the user has no write access to the
492 system directory. This feature makes it easier for users to have
493 personal terminfo entries without giving up access to the system
495 * You may specify a path of directories to search for compiled
496 descriptions with the environment variable TERMINFO_DIRS (this
497 generalizes the feature provided by TERMINFO under stock System
499 * In terminfo source files, use capabilities may refer not just to
500 other entries in the same source file (as in System V) but also to
501 compiled entries in either the system terminfo directory or the
502 user's $HOME/.terminfo directory.
503 * A script (capconvert) is provided to help BSD users transition
504 from termcap to terminfo. It gathers the information in a TERMCAP
505 environment variable and/or a ~/.termcap local entries file and
506 converts it to an equivalent local terminfo tree under
508 * Automatic fallback to the /etc/termcap file can be compiled in
509 when it is not possible to build a terminfo tree. This feature is
510 neither fast nor cheap, you don't want to use it unless you have
512 * The table-of-entries utility toe makes it easy for users to see
513 exactly what terminal types are available on the system.
514 * The library meets the XSI requirement that every macro entry point
515 have a corresponding function which may be linked (and will be
516 prototype-checked) if the macro definition is disabled with
518 * An HTML "Introduction to Programming with NCURSES" document
519 provides a narrative introduction to the curses programming
524 Numerous bugs present in earlier versions have been fixed; the library
525 is far more reliable than it used to be. Bounds checking in many
526 `dangerous' entry points has been improved. The code is now type-safe
527 according to gcc -Wall. The library has been checked for malloc leaks
528 and arena corruption by the Purify memory-allocation tester.
530 The ncurses code has been tested with a wide variety of applications
531 including (versions starting with those noted):
534 Curses Development Kit
535 [4]http://invisible-island.net/cdk/
536 [5]http://www.vexus.ca/products/CDK/
540 [6]http://invisible-island.net/ded/
543 the underlying application used in Slackware's setup, and the
544 basis for similar applications on GNU/Linux.
545 [7]http://invisible-island.net/dialog/
548 the character-screen WWW browser
549 [8]http://lynx.isc.org/release/
553 [9]http://www.midnight-commander.org/
557 [10]http://www.mutt.org/
560 file-transfer utility
561 [11]http://www.ncftp.com/
564 New vi versions 1.50 are able to use ncurses versions 1.9.7 and
566 [12]https://sites.google.com/a/bostic.com/keithbostic/nvi
569 Lynx-like info browser.
570 [13]https://alioth.debian.org/projects/pinfo/
573 newsreader, supporting color, MIME [14]http://www.tin.org/
575 as well as some that use ncurses for the terminfo support alone:
579 [15]http://alioth.debian.org/projects/minicom/
583 [16]http://invisible-island.net/vile/
585 The ncurses distribution includes a selection of test programs
586 (including a few games).
588 Who's Who and What's What
590 Zeyd Ben-Halim started it from a previous package pcurses, written by
591 Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer
592 wrote most of the form and menu libraries. Ongoing work is being done
593 by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the
594 Free Software Foundation, which holds the copyright on ncurses.
595 Contact the current maintainers at [18]bug-ncurses@gnu.org.
597 To join the ncurses mailing list, please write email to
598 bug-ncurses-request@gnu.org containing the line:
599 subscribe <name>@<host.domain>
601 This list is open to anyone interested in helping with the development
602 and testing of this package.
604 Beta versions of ncurses and patches to the current release are made
605 available at [19]ftp://invisible-island.net/ncurses/ .
609 * Extended-level XPG4 conformance, with internationalization
611 * Ports to more systems, including DOS and Windows.
613 We need people to help with these projects. If you are interested in
614 working on them, please join the ncurses list.
616 Other Related Resources
618 The distribution provides a newer version of the terminfo-format
619 terminal description file once maintained by [20]Eric Raymond . Unlike
620 the older version, the termcap and terminfo data are provided in the
621 same file, and provides several user-definable extensions beyond the
622 X/Open specification.
624 You can find lots of information on terminal-related topics not
625 covered in the terminfo file at [21]Richard Shuford's archive .
629 1. ftp://ftp.gnu.org/gnu/ncurses/
630 2. ftp://invisible-island.net/ncurses/
631 3. http://invisible-island.net/cindent/cindent.html
632 4. http://invisible-island.net/cdk/
633 5. http://www.vexus.ca/products/CDK/
634 6. http://invisible-island.net/ded/
635 7. http://invisible-island.net/dialog/
636 8. http://lynx.isc.org/release/
637 9. http://www.midnight-commander.org/
638 10. http://www.mutt.org/
639 11. http://www.ncftp.com/
640 12. https://sites.google.com/a/bostic.com/keithbostic/nvi
641 13. https://alioth.debian.org/projects/pinfo/
642 14. http://www.tin.org/
643 15. http://alioth.debian.org/projects/minicom/
644 16. http://invisible-island.net/vile/
645 17. mailto:dickey@invisible-island.net
646 18. mailto:bug-ncurses@gnu.org
647 19. ftp://invisible-island.net/ncurses/
648 20. http://www.catb.org/~esr/terminfo/
649 21. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal