ncurses (new curses) is a programming library for creating textual user interfaces (TUIs) that work across a wide variety of terminals. It is written in a way that attempts to optimize the commands that are sent to the terminal, to reduce the latency experienced when updating the displayed content.

ncurses is a free and open-source software emulation of curses from System V Release 4.0 (SVr4).

There are bindings for ncurses in a variety of programming languages, including Ada, Common Lisp, Python, Gambas, Ruby, PHP, JavaScript, Perl, Object REXX (ooRexx) and Rust.

History

As the new version, ncurses is a free and open-source software emulation of the System V Release 4.0 (SVr4) curses, which was an enhancement over the discontinued 4.4 BSD curses.

The success of the BSD curses library prompted Bell Labs to release an enhanced curses library in their System V Release 2 Unix systems. This library was more powerful and instead of using termcap, it used terminfo. However, due to AT&T's policy regarding the distribution of source code, the improved curses library was not widely adopted in the BSD community.

ncurses

The pcurses library was further improved when Zeyd Ben-Halim took over the development effort in late 1991. The new library was released as ncurses in November 1993, with version 1.8.1 as the first major release. Subsequent work, through version 1.8.8 (M1995), was driven by Eric S. Raymond, who added the form and menu libraries written by Juergen Pfeifer. Since 1996, it has been maintained by Thomas E. Dickey. However, a few areas are problematic, such as handling terminal resizing, since no counterpart exists in the old curses.

Terminal database

ncurses can use either terminfo (with extensible data) or termcap. Other implementations of curses generally use terminfo; a minority use termcap. Few (mytinfo was an older exception) use both.

License

ncurses is a part of the GNU Project, but is not distributed under the GNU General Public License (GPL) or GNU Lesser General Public License (LGPL). Instead, it is distributed under a permissive free software licence: the MIT License. This is due to the agreement made with the Free Software Foundation at the time the developers assigned their copyright.

When the agreement was made to pass on the rights to the FSF, there was a clause that stated: Some, such as GNU Screen and w3m, use only the termcap interface and perform screen management themselves. Others, such as GNU Midnight Commander and Yet another Setup Tool (YaST), use the curses programming interface.

See also

  • conio.h – A C header file used mostly with MS-DOS compilers to create text user interfaces
  • Curses Development Kit
  • Dialog (software)
  • PDCurses
  • S-Lang programming library
  • SMG$ – Screen-management library available under OpenVMS
  • GNU Readline

References