5 The ncurses (new curses) library is a free software emulation of
6 curses in System V Release 4.0 (SVr4), and more. It uses terminfo
7 format, supports pads and color and multiple highlights and forms
8 characters and function-key mapping, and has all the other SVr4-curses
9 enhancements over BSD curses. SVr4 curses became the basis of X/Open
12 In mid-June 1995, the maintainer of 4.4BSD curses declared that he
13 considered 4.4BSD curses obsolete, and encouraged the keepers of unix
14 releases such as BSD/OS, FreeBSD and NetBSD to switch over to ncurses.
16 Since 1995, ncurses has been ported to many systems:
17 * It is used in almost every system based on the Linux kernel (aside
18 from some embedded applications).
19 * It is used as the system curses library on OpenBSD, FreeBSD and
21 * It is used in environments such as Cygwin and MinGW. The first of
22 these was EMX on OS/2 Warp.
23 * It is used (though usually not as the system curses) on all of the
24 vendor unix systems, e.g., AIX, HP-UX, IRIX64, SCO, Solaris,
26 * It should work readily on any ANSI/POSIX-conforming unix.
28 The distribution includes the library and support utilities, including
29 * captoinfo, a termcap conversion tool
30 * clear, utility for clearing the screen
31 * infocmp, the terminfo decompiler
32 * tabs, set tabs on a terminal
33 * tic, the terminfo compiler
34 * toe, list (table of) terminfo entries
35 * tput, utility for retrieving terminal capabilities in shell
37 * tset, to initialize the terminal
39 Full manual pages are provided for the library and tools.
41 The ncurses distribution is available at ncurses' homepage:
43 ftp://ftp.invisible-island.net/ncurses/ or
44 https://invisible-mirror.net/archives/ncurses/ .
46 It is also available via anonymous FTP at the GNU distribution site
48 ftp://ftp.gnu.org/gnu/ncurses/ .
52 These notes are for ncurses 6.3, released October 21, 2021.
54 This release is designed to be source-compatible with ncurses 5.0
55 through 6.2; providing extensions to the application binary interface
56 (ABI). Although the source can still be configured to support the
57 ncurses 5 ABI, the reason for the release is to reflect improvements
58 to the ncurses 6 ABI and the supporting utility programs.
60 There are, of course, numerous other improvements, listed in this
63 The most important bug-fixes/improvements dealt with portability
64 issues. The release notes also mention some other bug-fixes, but are
65 focused on new features and improvements to existing features since
72 There are a few new features:
73 * A new (experimental) driver, for the Windows Terminal
74 configuration is provided.
75 * A script is provided which enables OpenBSD users to upgrade their
76 system to use ncurses 6.3 (OpenBSD developers are also invited to
79 Additionally, to improve performance other changes (and extensions)
80 are provided in this release:
81 * modify lib_mouse.c to check for out-of-range button numbers,
82 convert those to position reports.
83 * add sp-funcs for erasewchar, killwchar.
87 These are revised features:
88 * modify wgetnstr, wgetn_wstr to improve compatibility with SVr4
89 curses in its treatment of interrupt and quit characters
91 These were done to limit or ultimately deprecate features:
92 * mark wgetch-events feature as deprecated.
93 + prevent KEY_EVENT from appearing in curses.h unless the
94 configure option --enable-wgetch-events is used.
95 + modify MKkey_defs.sh to hide ncurses' definition of
96 KEY_EVENTS to reduce Visual Studio C++ redefinition warnings.
97 * reduce build-warnings by excluding ncurses-internals from
100 These are improvements to existing features:
101 * drop symbols GCC_PRINTF and GCC_SCANF from <curses.h>, to simplify
103 * apply gcc format attribute to prototypes which use a va_list
104 parameter rather than a "..." variable-length parameter list.
105 * modify <term.h> so that it is not necessary to include <curses.h>
107 * provide for wide-characters as background character in wbkgrnd
108 * improve parameter-checking for tparm, adding function _nc_tiparm()
109 to handle the most-used case, which accepts only numeric
111 * use return-value from vsnprintf to reallocate as needed to allow
112 for buffers larger than the screen size.
113 * add another fflush(stdout) in _nc_flush to handle time-delays in
114 the middle of strings such as flash when the application uses
115 low-level calls rather than curses.
117 These are corrections to existing features:
118 * add a check to guard against repeat_char emitting digits which
119 could be interpreted as BSD-style padding when --enable-bsdpad is
121 * check for screen size-change in scr_init and scr_restore, in case
122 a screen dump does not match the current screen dimensions
126 Several improvements were made to the utility programs:
130 + implement "+m" option
134 + add check for duplicate "use=" clauses.
135 + add check to report instances where tparm would detect an
136 error in an expression.
137 + add user-defined capabilities from mintty to Caps-ncurses,
138 for checking consistency.
139 + improve warning when oc/op do not mention SGR 39/49 for xterm
141 + improve checks for number of parameters of smglp, smgrp,
143 + improve "-c" option to validate the number and type of
144 parameters and compare against expected number/type before
145 deciding which set of parameter-lists to use in tparm calls.
146 + improve check for errors detected in tparm.
147 + improve format of output, to ensure that the messages contain
149 + modify to eliminate unnecessary "\" to escape ":" in terminfo
151 + remove check that assumes that none or both parameterized and
152 non-parameterized margin-setting capabilities are present.
156 + modify output of "toe -as" to show first description found
157 rather than the last.
158 + add a check to ensure that a "termcap file" is text rather
163 + modify to allow multiple commands per line.
164 + improve parameter-checking by analyzing all extended string
165 capabilities, e.g., as used in the Cs and Ms capabilities of
166 the tmux description.
167 + make warning messages consistently using alias names when
168 those are used, rather than the underlying program's name.
169 + improve usage message for aliases such as clear, by
170 eliminating tput-specific portions.
171 + modify initialization to avoid opening /dev/tty for cases
172 other than reset/init, e.g., for clear.
176 Along with the library and utilities, improvements were made to the
177 ncurses-examples. Most of this activity aimed at improving the
178 test-packages. A few changes are more generally useful, e.g., for the
179 main ncurses test-program, and for analyzing traces using the
181 * add "-r" option to the dots test-programs, to help with scripting
182 a performance comparison.
183 * build-fix for test_opaque, for configurations without opaque
184 curses structs, e.g., ncurses 5.7.
185 * improve tracemunch logic for "RUN" compaction.
186 * improve tracemunch's coverage of form/menu/panel libraries.
187 * improve tracemunch's checking/reporting the type for the first
188 parameter, e.g., "WINDOW*" rather than "#1".
189 * modify tracemunch and the panel library to show readable traces
190 for panel- and user-pointers.
192 There are other new demo/test programs and reusable examples:
195 to exercise the wide-character background functions.
198 to demonstrate move_field, and a stub for a corresponding demo
202 for checking tparm changes.
206 There are several new terminal descriptions:
208 absolute, att610+cvis, foot, foot-direct, hp98550-color,
209 hpterm-color2, hterm, hterm-256color, linux-s, putty+keypad,
210 putty+screen, putty-screen, screen.linux-s, scrt/securecrt,
211 tmux-direct, vt220+cvis, vt220+cvis8, vt220+pcedit, vt220+vtedit,
212 vt220-base, vt52+keypad, xterm+256color2, xterm+88color2,
213 xterm-direct16, xterm-direct256, xterm+nofkeys, and
216 There are many changes to existing terminal descriptions. Some were
217 updates to several descriptions:
218 * correct use-ordering in some xterm-direct flavors
219 * fix some sgr inconsistencies in d230c, ibm6153, ibm6154,
221 * improve vt50h and vt52 based on DECScope manual
222 * use hp+arrows in a few places
223 * use hp+pfk-cr in a few places
224 * use vt220+cvis in st, terminology, termite since they ignore
225 blinking-cursor detail in att610+cvis
227 while others affected specific descriptions. These were retested, to
228 take into account changes by their developers:
230 kitty+common, mlterm3, ms-terminal
232 while these are specific fixes based on reviewing documentation, user
233 reports, or warnings from tic:
245 use att610+cvis, xterm+tmux and ansi+enq
251 fix pound-sign mapping in acsc
254 modify to reflect default mapping of shift-tab by kbd 1.14
257 fill in some missing pieces, to make it comparable to the vt220
261 use vt100+fnkeys, add rep
267 corrected tsl capability
290 A few entries use extensions (user-defined terminal capabilities):
291 * add shifted Linux console keys in linux+sfkeys entry for
293 * add Smulx to alacritty
294 * add kbeg to xterm+keypad to accommodate termcap applications
295 * add extensions in xterm+tmux and ecma+strikeout to ms-terminal,
296 but cancel the non-working Cr and Ms capabilities
300 As usual, this release
301 * improves documentation by describing new features,
302 * attempts to improve the description of features which users have
304 * fills in overlooked descriptions of features which were described
305 in the NEWS file but treated sketchily in manual pages.
307 In addition to providing background information to explain these
308 features and show how they evolved, there are corrections,
309 clarifications, etc.:
311 + make opts extension for getcchar work as documented for
312 ncurses 6.1, adding "-g" flag to demo_new_pair to illustrate.
313 + modify tset "-q" option to refrain from modifying terminal
314 modes, to match the documentation.
315 * New/improved history and portability sections:
316 + improve documentation for tparm and static/dynamic variables.
317 + add history note to curs_scanw.3x for <stdarg.h> and
319 + add history note to curs_printw.3x for <stdarg.h> and
321 + add portability note to ncurses.3x regarding <stdarg.h>
322 + add historical notes to tput, curses-terminfo and
323 curses-color manpages based on source-code for SVr2, SVr3 and
325 + improve history section for tset manpage based on the 1BSD
326 tarball, which preceded BSD's SCCS checkins by more than
328 * Other improvements:
329 + explain in ncurses.3x that functions in the tinfo library do
330 not rely upon wide-characters.
331 + improve manual page for panel library, extending the
332 portability section as well as documenting error-returns.
333 + add section on margins to terminfo.5, adapted from X/Open
335 + improve man/term.5 section on legacy storage format.
336 + add a note in terminfo.5 explaining that no-parameter strings
337 such as sgr0 or cnorm should not be used with tparm.
338 + improve description of BSD-style padding in curs_termcap.3x
339 + improve discussion of padding versus tparm and tputs in
341 + add a note in manual page to explain ungetch vs unget_wch.
342 + improve description of error-returns in waddch and waddnstr
345 There are no new manual pages (all of the manual page updates are to
348 Some of the improvements are more subtle, relating to the way the
349 information is presented. For instance, hyphenation is suppressed in
350 the HTML files generated from manual pages because an upgrade to groff
351 gave noticeably poorer results, interfering with the process of
352 creating links between the resulting webpages.
354 Interesting bug-fixes
356 While there were many bugs fixed during development of ncurses 6.3,
357 only a few (the reason for this release) were both important and
358 interesting. Most of the bug-fixes were for local issues which did not
359 affect compatibility across releases. Since those are detailed in the
360 NEWS file no elaboration is needed here.
362 The interesting bugs were:
363 * modify wbkgd and wbkgrnd to avoid storing a null in the background
364 character, because it may be used in cases where the corresponding
365 0x80 is not treated as a null.
366 This was a regression introduced in ncurses 6.2 (reported on the
367 mailing list), for which the workaround was to specify a blank for
368 the background character.
369 * remove output-related checks for nl/nonl (also reported on the
371 * improve tparm implementation of %P and %g, more closely matching
372 SVr4 terminfo. Those denote static and dynamic variables in
373 terminfo expressions.
374 Exactly what those terms meant was never documented before in any
375 implementation of curses, aside from source code. Unlike the other
376 two fixes, the problem was discovered while studying OpenBSD's
379 Configuration changes
383 There are no major changes. Several new options were added to ease
384 integration of packages with systems using different versions of GNAT
385 and ncurses. Also, improvements were made to configure checks.
387 Configuration options
389 There are a few new/modified configure options:
392 new configure option and check for gcc -fvisibility=hidden
396 corrected to allow turning leak-checking off later in a set of
400 new configure option makes the _Noreturn keyword optional to
403 --disable-pkg-ldflags
404 revised option also controls whether $LDFLAGS from the build is
405 provided in "-config" and ".pc" files.
407 --disable-root-access
408 add configure option which tells ncurses to disallow most
409 file-opens by setuid processes.
411 --disable-wattr-macros
412 changed default to help packagers who reuse wide ncursesw
413 header file with non-wide ncurses library.
415 --with-pkg-config-libdir
416 revised option uses the actual search path from pkg-config or
417 pkgconf using the output from --debug.
423 new several --with-xxx-libname options, to help with pkgsrc
427 Many of the portability changes are implemented via the configure
429 * add a special case in the configure script to work around one of
430 the build-time breakages reported for OpenBSD 6 here:
432 https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
433 * modify configure check for libtool to prevent accidental use of an
434 OpenBSD program which uses the same name.
435 * modify configuration checks for build-time tic/infocmp to use
436 AC_CHECK_TOOL. That can still be overridden by --with-tic-path and
437 --with-infocmp-path when fallbacks are used, but even if not using
438 fallbacks, the improved check may help with cross-compiling.
439 * relax modification-time comparison in CF_LINK_FUNCS to allow it to
440 accept link() function with NFS filesystems which change the mtime
441 on the link target, e.g., several BSD systems.
442 * modify configure check for c89/c99 aliases of clang to use its
443 -std option instead, because some platforms, in particular macOS,
444 do not provide workable c89/c99 aliases.
445 * modify CF_NCURSES_CONFIG to work around Xcode's c99 "-W" option,
446 which conflicts with conventional use for passing linker options.
447 * modify configure scripts to filter out redefinitions of
448 _XOPEN_SOURCE, e.g., for NetBSD which generally supports 500, but
449 600 is needed for ncursesw.
451 Here are some of the other portability fixes:
452 * change configure-check and source-code for gcc's noreturn
453 attribute to assume it is a prefix rather than suffix, matching
454 c11's _Noreturn convention.
455 * modify mk-1st.awk to account for extra-suffix configure option.
456 * build-fix for termsort module when configured with termcap.
457 * modify configure script and makefiles to support ".PHONY" make
459 * amend libtool configuration to add dependency for install.tic,
460 etc., in ncurses/Makefile on the lower-level libraries.
461 * modify Ada95 source-generation utility to write to a file given as
462 parameter rather than to the standard output, allowing builds with
464 * amend tic/infocmp check to allow for the respective tool's
466 * build-fixes for gnat 10.1.1, whose gnatmake drops integration with
468 * correct configure version-check/warning for g++ to allow for 10.x
469 _________________________________________________________________
473 The ncurses package is fully upward-compatible with SVr4 (System V
475 * All of the SVr4 calls have been implemented (and are documented).
476 * ncurses supports all of the for SVr4 curses features including
477 keyboard mapping, color, forms-drawing with ACS characters, and
478 automatic recognition of keypad and function keys.
479 * ncurses provides these SVr4 add-on libraries (not part of X/Open
481 + the panels library, supporting a stack of windows with
483 + the menus library, supporting a uniform but flexible
484 interface for menu programming.
485 + the form library, supporting data collection through
487 * ncurses's terminal database is fully compatible with that used by
489 + ncurses supports user-defined capabilities which it can see,
490 but which are hidden from SVr4 curses applications using the
491 same terminal database.
492 + It can be optionally configured to match the format used in
493 related systems such as AIX and Tru64.
494 + Alternatively, ncurses can be configured to use hashed
495 databases rather than the directory of files used by SVr4
497 * The ncurses utilities have options to allow you to filter terminfo
498 entries for use with less capable curses/terminfo versions such as
499 the HP-UX and AIX ports.
501 The ncurses package also has many useful extensions over SVr4:
502 * The API is 8-bit clean and base-level conformant with the X/OPEN
503 curses specification, XSI curses (that is, it implements all BASE
504 level features, and most EXTENDED features). It includes many
505 function calls not supported under SVr4 curses (but portability of
506 all calls is documented so you can use the SVr4 subset only).
507 * Unlike SVr3 curses, ncurses can write to the rightmost-bottommost
508 corner of the screen if your terminal has an insert-character
510 * Ada95 and C++ bindings.
511 * Support for mouse event reporting with X Window xterm and FreeBSD
512 and OS/2 console windows.
513 * Extended mouse support via Alessandro Rubini's gpm package.
514 * The function wresize allows you to resize windows, preserving
516 * The function use_default_colors allows you to use the terminal's
517 default colors for the default color pair, achieving the effect of
519 * The functions keyok and define_key allow you to better control the
520 use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by
521 defining more than one control sequence to map to a given key
523 * Support for direct-color terminals, such as modern xterm.
524 * Support for 256-color terminals, such as modern xterm.
525 * Support for 16-color terminals, such as aixterm and modern xterm.
526 * Better cursor-movement optimization. The package now features a
527 cursor-local-movement computation more efficient than either BSD's
529 * Super hardware scrolling support. The screen-update code
530 incorporates a novel, simple, and cheap algorithm that enables it
531 to make optimal use of hardware scrolling, line-insertion, and
532 line-deletion for screen-line movements. This algorithm is more
533 powerful than the 4.4BSD curses quickch routine.
534 * Real support for terminals with the magic-cookie glitch. The
535 screen-update code will refrain from drawing a highlight if the
536 magic- cookie unattributed spaces required just before the
537 beginning and after the end would step on a non-space character.
538 It will automatically shift highlight boundaries when doing so
539 would make it possible to draw the highlight without changing the
540 visual appearance of the screen.
541 * It is possible to generate the library with a list of pre-loaded
542 fallback entries linked to it so that it can serve those terminal
543 types even when no terminfo tree or termcap file is accessible
544 (this may be useful for support of screen-oriented programs that
545 must run in single-user mode).
546 * The tic/captoinfo utility provided with ncurses has the ability to
547 translate many termcaps from the XENIX, IBM and AT&T extension
549 * A BSD-like tset utility is provided.
550 * The ncurses library and utilities will automatically read terminfo
551 entries from $HOME/.terminfo if it exists, and compile to that
552 directory if it exists and the user has no write access to the
553 system directory. This feature makes it easier for users to have
554 personal terminfo entries without giving up access to the system
556 * You may specify a path of directories to search for compiled
557 descriptions with the environment variable TERMINFO_DIRS (this
558 generalizes the feature provided by TERMINFO under stock System
560 * In terminfo source files, use capabilities may refer not just to
561 other entries in the same source file (as in System V) but also to
562 compiled entries in either the system terminfo directory or the
563 user's $HOME/.terminfo directory.
564 * The table-of-entries utility toe makes it easy for users to see
565 exactly what terminal types are available on the system.
566 * The library meets the XSI requirement that every macro entry point
567 has a corresponding function which may be linked (and will be
568 prototype-checked) if the macro definition is disabled with
570 * Extensive documentation is provided (see the Additional Reading
571 section of the ncurses FAQ for online documentation).
573 Applications using ncurses
575 The ncurses distribution includes a selection of test programs
576 (including a few games). These are available separately as
579 The ncurses library has been tested with a wide variety of
580 applications including:
583 FrontEnd to Apt, the debian package manager
585 https://wiki.debian.org/Aptitude
588 Curses Development Kit
590 https://invisible-island.net/cdk/
595 https://invisible-island.net/ded/
598 the underlying application used in Slackware's setup, and the
599 basis for similar install/configure applications on many
602 https://invisible-island.net/dialog/
607 https://lynx.invisible-island.net/
615 file-transfer utility
617 https://www.ncftp.com/
622 https://sites.google.com/a/bostic.com/keithbostic/vi
625 A console file manager with VI key bindings in Python.
627 https://ranger.github.io/
630 newsreader, supporting color, MIME
635 File manager with vi like keybindings
639 as well as some that use ncurses for the terminfo support alone:
642 terminal emulator for serial modem connections
644 https://alioth.debian.org/projects/minicom/
647 a replacement for ssh.
652 terminfo action checker
654 https://invisible-island.net/ncurses/tack.html
659 https://github.com/tmux/tmux/wiki
662 vi-like-emacs may be built to use the terminfo, termcap or
665 https://invisible-island.net/vile/
667 and finally, those which use only the termcap interface:
672 https://www.gnu.org/software/emacs/
675 The most commonly used pager (a program that displays text
678 http://www.greenwoodsoftware.com/less/
683 https://www.gnu.org/software/screen/
690 Development activities
692 Zeyd Ben-Halim started ncurses from a previous package pcurses,
693 written by Pavel Curtis. Eric S. Raymond continued development.
694 Juergen Pfeifer wrote most of the form and menu libraries.
696 Ongoing development work is done by Thomas E. Dickey. Thomas E. Dickey
697 has acted as the maintainer for the Free Software Foundation, which
698 held a copyright on ncurses for releases 4.2 through 6.1. Following
699 the release of ncurses 6.1, effective as of release 6.2, copyright for
700 ncurses reverted to Thomas E. Dickey (see the ncurses FAQ for
701 additional information).
703 Contact the current maintainers at
707 To join the ncurses mailing list, please write email to
709 bug-ncurses-request@gnu.org
713 subscribe <name>@<host.domain>
715 This list is open to anyone interested in helping with the development
716 and testing of this package.
718 Beta versions of ncurses are made available at
720 ftp://ftp.invisible-island.net/ncurses/current/ and
721 https://invisible-mirror.net/archives/ncurses/current/ .
723 Patches to the current release are made available at
725 ftp://ftp.invisible-island.net/ncurses/6.2/ and
726 https://invisible-mirror.net/archives/ncurses/6.2/ .
728 There is an archive of the mailing list here:
730 http://lists.gnu.org/archive/html/bug-ncurses (also https)
734 The release notes make scattered references to these pages, which may
735 be interesting by themselves:
737 * Symbol versioning in ncurses
738 * Comments on ncurses versus slang (S-Lang)
739 * Comments on OpenBSD
740 * tack - terminfo action checker
741 * tctest - termcap library checker
746 The distribution provides a newer version of the terminfo-format
747 terminal description file once maintained by Eric Raymond . Unlike the
748 older version, the termcap and terminfo data are provided in the same
749 file, which also provides several user-definable extensions beyond the
750 X/Open specification.
752 You can find lots of information on terminal-related topics not
753 covered in the terminfo file at Richard Shuford's archive . The
754 collection of computer manuals at bitsavers.org has also been useful.
758 + Library improvements
761 + Program improvements
766 + Interesting bug-fixes
767 + Configuration changes
769 o Configuration options
771 * Features of ncurses
772 * Applications using ncurses
773 * Development activities