Ncurses

Text-based user interface API


title: "Ncurses" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["ncurses", "c-(programming-language)-libraries", "free-software-programmed-in-ada", "free-software-programmed-in-c", "gnu-project-software", "software-using-the-mit-license", "termcap", "terminfo"] description: "Text-based user interface API" topic_path: "general/ncurses" source: "https://en.wikipedia.org/wiki/Ncurses" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Text-based user interface API ::

::data[format=table title="Infobox software"]

FieldValue
namencurses
screenshotLinux-menuconfig.png
captionncurses-based menuconfig
developerThomas E. Dickey, Juergen Pfeifer, Eric S. Raymond, Alexander V Lukyanov, Philippe Blain, Sven Verdoolaege, Nicolas Boulenguez et al.
released
latest release version
latest release date
programming languageC
operating systemPOSIX
genreWidget toolkit
licenseX11
website
::

| name = ncurses | screenshot = Linux-menuconfig.png | caption = ncurses-based menuconfig | developer = Thomas E. Dickey, Juergen Pfeifer, Eric S. Raymond, Alexander V Lukyanov, Philippe Blain, Sven Verdoolaege, Nicolas Boulenguez et al. | released = | latest release version = | latest release date = | programming language = C | operating system = POSIX | genre = Widget toolkit | license = X11 | website =

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 XSI Curses standard issued by X/Open is explicitly and closely modeled on UNIX System V.

curses

Main article: Curses (programming library)

The first curses library was developed at University of California, Berkeley, for a BSD operating system, around 1980 to support Rogue, a text-based adventure game. It originally used the termcap library, which was used in other programs, such as the vi editor.{{cite magazine |last1=Raymond |first1=Eric S. |author1-link=Eric S. Raymond |date=September 1995 |url=http://www.linuxjournal.com/article/1124 |title=ncurses: Portable Screen-Handling for Linux |magazine=Linux Journal

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.

pcurses

Around 1982, Pavel Curtis started work on a freeware clone of the Bell Labs curses, named pcurses, which was maintained by various people through 1986.{{Cite web |last=Dickey |first=Thomas E. |date=December 1996 |url=http://invisible-island.net/ncurses/ |title=NCURSES - New Curses

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.

Most ncurses calls can be easily ported to the old curses. System V curses implementations can support BSD curses programs with just a recompilation. 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{{Cite web |last=Weinstein |first=Sydney S. |date=April 1993 |url=http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1993/9304/weinstei/weinstei.htm |title=On the Networks |publisher=C/C++ Users Journal |access-date=2017-09-15 |url-status=dead |archive-url=https://web.archive.org/web/20140811123402/http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1993/9304/weinstei/weinstei.htm |archive-date=2014-08-11

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: ::quote

The Foundation promises that all distribution of the Package, or of any work "based on the Package", that takes place under the control of the Foundation or its agents or assignees, shall be on terms that explicitly and perpetually permit anyone possessing a copy of the work to which the terms apply, and possessing accurate notice of these terms, to redistribute copies of the work to anyone on the same terms. ::

According to the maintainer Thomas E. Dickey, this precludes relicensing to the GPL in any version, since it would place restrictions on the programs that will be able to link to the libraries.

Programs using ncurses

Hundreds of programs use ncurses.{{Cite web |url=http://www.ohloh.net/tags/ncurses |title=Projects tagged 'ncurses' |publisher=ohloh |access-date=2008-03-28 |archive-date=2013-05-15 |archive-url=https://web.archive.org/web/20130515124809/http://www.ohloh.net/tags/ncurses |url-status=dead

References

References

  1. "NCURSES – Licensing".
  2. "Ada95 Binding for ncurses".
  3. "CL-Ncurses: An Ncurses and pdcurses interface for Common Lisp".
  4. "Curses Programming with Python - Python documentation".
  5. "gb.ncurses - Gambas Wiki".
  6. "ncurses Ruby - RubyGems.org".
  7. "Ncurses functions - PHP Manual".
  8. "nc plugin: ncurses bindings for SpiderApe".
  9. "Curses::UI - A curses based OO user interface framework".
  10. (2022). "ooRexx Documentation 5.0.0: nCurses Class Library Reference". Rexx Language Association.
  11. "Rust bindings for ncurses".
  12. The [[README]] file in ncurses 1.8.1 states "v0.1 July 31, 1992" and "v1.8.1 November 5, 1993", which agrees with the [http://invisible-island.net/ncurses/NEWS.gz NEWS (changelog) file]
  13. "NCURSES - Frequently Asked Questions (FAQ): Who wrote NCURSES?".
  14. "A Hacker's Guide to Ncurses Internals".
  15. "NCURSES - Frequently Asked Questions (FAQ): Is it GPL'd?".
  16. "Search results: +ncurses on freshmeat.net".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

ncursesc-(programming-language)-librariesfree-software-programmed-in-adafree-software-programmed-in-cgnu-project-softwaresoftware-using-the-mit-licensetermcapterminfo