Ncurses

From HandWiki - Reading time: 4 min

Short description: Text-based user interface API

ncurses
Linux-menuconfig.png
ncurses-based menuconfig
Developer(s)Thomas E. Dickey, Juergen Pfeifer, Eric S Raymond, Alexander V Lukyanov, Philippe Blain, Sven Verdoolaege, Nicolas Boulenguez et al.[1][2]
Initial release1993; 31 years ago (1993)
Stable release
6.4[3] / 31 December 2022; 18 months ago (2022-12-31)
Written inC
Operating systemPOSIX
TypeWidget toolkit
LicenseX11 License[2]
Website{{{1}}}

ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" application software that runs under a terminal emulator. It also optimizes screen changes, in order to reduce the latency experienced when using remote shells.

ncurses is a free-software emulation of the System V Release 4.0 (SVr4) curses.

There are bindings for ncurses in a variety of programming languages, including Ada,[4] Python,[5] Gambas,[6] Ruby,[7] PHP,[8] JavaScript,[9] and Perl.[10]

History

As the new version, ncurses is a free-software emulation of the System V Release 4.0 (SVr4) curses, which was itself an enhancement over the discontinued 4.4 BSD curses.[11] The XSI Curses standard issued by X/Open is explicitly and closely modeled on System V.

curses

Main page: Software:Curses (programming library)

The first curses library was developed at the University of California at 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.[11]

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 policy regarding source-code distribution, this improved curses library did not have much acceptance in the BSD community.[11]

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.[12]

ncurses

The pcurses library was further improved when Zeyd Ben-Halim took over the development effort in late 1991.[11][12][13] 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.[1] Since 1996, it has been maintained by Thomas E. Dickey.[12]

Most ncurses calls can be easily ported to the old curses. System V curses implementations can support BSD curses programs with just a recompilation.[14] 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[15]) use both.

License

ncurses is a part of the GNU Project, but is not distributed under the GNU GPL or LGPL. Instead, it is distributed under a permissive free software licence, i.e., the MIT License.[16] 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:[16]

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.[16]

Programs using ncurses

There are hundreds of programs which use ncurses.[17][18] Some, such as GNU Screen and w3m, use only the termcap interface and perform screen management themselves. Others, such as GNU Midnight Commander and YaST, use the curses programming interface.

See also

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

Notes

References

  1. 1.0 1.1 "NCURSES - Frequently Asked Questions (FAQ): Who wrote NCURSES?". http://invisible-island.net/ncurses/ncurses.faq.html#who_did_it. 
  2. 2.0 2.1 "NCURSES — Licensing". http://invisible-island.net/ncurses/ncurses-license.html. 
  3. "ncurses 6.4". https://lists.gnu.org/archive/html/info-gnu/2022-12/msg00010.html. 
  4. "Ada95 Binding for ncurses". https://invisible-island.net/ncurses/Ada95.html. 
  5. "Curses Programming with Python - Python documentation". https://docs.python.org/3/howto/curses.html. 
  6. "gb.ncurses - Gambas Wiki". http://gambaswiki.org/wiki/comp/gb.ncurses. 
  7. "ncurses Ruby - RubyGems.org". https://rubygems.org/gems/ncurses-ruby/versions/1.2.4. 
  8. "Ncurses functions - PHP Manual". https://www.php.net/manual/en/ref.ncurses.php. 
  9. "nc plugin: ncurses bindings for SpiderApe". http://spiderape.sourceforge.net/plugins/ncurses/. 
  10. "Curses::UI - A curses based OO user interface framework". https://metacpan.org/pod/Curses::UI. 
  11. 11.0 11.1 11.2 11.3 Eric S. Raymond (September 1995). "ncurses: Portable Screen-Handling for Linux". Linux Journal. http://www.linuxjournal.com/article/1124. 
  12. 12.0 12.1 12.2 Thomas E. Dickey (December 1996). "NCURSES - New Curses". http://invisible-island.net/ncurses/. 
  13. 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 NEWS (changelog) file
  14. "A Hacker's Guide to Ncurses Internals". http://invisible-island.net/ncurses/hackguide.html#abstract. 
  15. Sydney S. Weinstein (April 1993). "On the Networks". C/C++ Users Journal. http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1993/9304/weinstei/weinstei.htm. 
  16. 16.0 16.1 16.2 "NCURSES - Frequently Asked Questions (FAQ): Is it GPL'd?". http://invisible-island.net/ncurses/ncurses.faq.html#is_it_gpl. 
  17. "Search results: +ncurses on freshmeat.net". http://freshmeat.net/search/?q=ncurses&section=projects&Go.x=0&Go.y=0. 
  18. "Projects tagged 'ncurses'". ohloh. http://www.ohloh.net/tags/ncurses. 

External links




Licensed under CC BY-SA 3.0 | Source: https://handwiki.org/wiki/Software:Ncurses
14 views | Status: cached on July 14 2024 10:24:43
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF