Ncurses

Last updated
ncurses
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.5 [3] / 27 April 2024;21 days ago (2024-04-27)
Repository
Written in C
Operating system POSIX
Type Widget toolkit
License X11 License [2]
Website invisible-island.net/ncurses/ OOjs UI icon edit-ltr-progressive.svg

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.

Contents

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] Perl, [10] and ooRexx. [11]

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

curses

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

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

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

ncurses

The pcurses library was further improved when Zeyd Ben-Halim took over the development effort in late 1991. [12] [13] [14] 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. [13]

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

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

Programs using ncurses

There are hundreds of programs which use ncurses. [18] [19] 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

Related Research Articles

<span class="mw-page-title-main">GNU Debugger</span> Source-level debugger

The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, Assembly, C, C++, D, Fortran, Haskell, Go, Objective-C, OpenCL C, Modula-2, Pascal, Rust, and partially others.

<span class="mw-page-title-main">GNU Lesser General Public License</span> Free-software license

The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own software without being required by the terms of a strong copyleft license to release the source code of their own components. However, any developer who modifies an LGPL-covered component is required to make their modified version available under the same LGPL license. For proprietary software, code under the LGPL is usually used in the form of a shared library, so that there is a clear separation between the proprietary and LGPL components. The LGPL is primarily used for software libraries, although it is also used by some stand-alone applications.

The MIT License is a permissive software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts very few restrictions on reuse and therefore has high license compatibility.

curses (programming library) Terminal control library enabling construction of text user interfaces

curses is a terminal control library for Unix-like systems, enabling the construction of text user interface (TUI) applications.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of bitmapped displays and modern conventional graphical user interfaces (GUIs). Like modern GUIs, they can use the entire screen area and may accept mouse and other inputs. They may also use color and often structure the display using box-drawing characters such as ┌ and ╣. The modern context of use is usually a terminal emulator.

GNU Parted is a free partition editor, used for creating and deleting partitions. This is useful for creating space for new operating systems, reorganising hard disk usage, copying data between hard disks, and disk imaging. It was written by Andrew Clausen and Lennert Buytenhek.

<span class="mw-page-title-main">GNU Screen</span> Terminal multiplexer software

GNU Screen is a terminal multiplexer, a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate login sessions inside a single terminal window, or detach and reattach sessions from a terminal. It is useful for dealing with multiple programs from a command line interface, and for separating programs from the session of the Unix shell that started the program, particularly so a remote process continues running even when the user is disconnected.

nvi Re-implementation of ex/vi

nvi is a re-implementation of the classic Berkeley text editor, ex/vi, traditionally distributed with BSD and, later, Unix systems. It was originally distributed as part of the Fourth Berkeley Software Distribution (4BSD).

The GNU Scientific Library is a software library for numerical computations in applied mathematics and science. The GSL is written in C; wrappers are available for other programming languages. The GSL is part of the GNU Project and is distributed under the GNU General Public License.

GNU Readline is a software library that provides in-line editing and history capabilities for interactive programs with a command-line interface, such as Bash. It is currently maintained by Chet Ramey as part of the GNU Project.

CDK is a library written in C that provides a collection of widgets for text user interfaces (TUI) development. The widgets wrap ncurses functionality to make writing full screen curses programs faster. Perl and Python bindings are also available.

<span class="mw-page-title-main">Terminfo</span> Concept in computer programming

Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. Mary Ann Horton implemented the first terminfo library in 1981–1982 as an improvement over termcap. The improvements include

<span class="mw-page-title-main">Termcap</span>

Termcap is a legacy software library and database used on Unix-like computers that enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text mode applications. It was superseded by the terminfo database used by ncurses, tput, and other programs.

<span class="mw-page-title-main">Dialog (software)</span>

Dialog is an application used in shell scripts which displays text user interface widgets. It uses the curses or ncurses library. The latter provides users with the ability to use a mouse, e.g., in an xterm.

In computing, tput is a standard Unix operating system command which makes use of terminal capabilities.

<span class="mw-page-title-main">Free-software license</span> License allowing software modification and redistribution

A free-software license is a notice that grants the recipient of a piece of software extensive rights to modify and redistribute that software. These actions are usually prohibited by copyright law, but the rights-holder of a piece of software can remove these restrictions by accompanying the software with a software license which grants the recipient these rights. Software using such a license is free software as conferred by the copyright holder. Free-software licenses are applied to software in source code and also binary object-code form, as the copyright law recognizes both forms.

<span class="mw-page-title-main">GNU General Public License</span> Series of free software licenses

The GNU General Public License is a series of widely used free software licenses, or copyleft, that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general use, and was originally written by Richard Stallman, the founder of the Free Software Foundation (FSF), for the GNU Project. The license grants the recipients of a computer program the rights of the Free Software Definition. The licenses in the GPL series are all copyleft licenses, which means that any derivative work must be distributed under the same or equivalent license terms. It is more restrictive than the Lesser General Public License, and even further distinct from the more widely-used permissive software licenses BSD, MIT, and Apache.

<span class="mw-page-title-main">WeeChat</span> IRC client

WeeChat is a free and open-source Internet Relay Chat client that is designed to be light and fast. It is released under the terms of the GNU GPL-3.0-or-later and has been developed since 2003.

Twin is a windowing environment with mouse support, window manager, terminal emulator and networked clients, all inside a text mode display. Twin is tested on Linux, FreeBSD, and macOS.

References

  1. 1 2 "NCURSES - Frequently Asked Questions (FAQ): Who wrote NCURSES?".
  2. 1 2 "NCURSES Licensing" . Retrieved July 9, 2013.
  3. "ncurses 6.5" . Retrieved April 27, 2024.
  4. "Ada95 Binding for ncurses".
  5. "Curses Programming with Python - Python documentation".
  6. "gb.ncurses - Gambas Wiki".
  7. "ncurses Ruby - RubyGems.org".
  8. "Ncurses functions - PHP Manual". Archived from the original on 2021-03-28. Retrieved 2020-02-04.
  9. "nc plugin: ncurses bindings for SpiderApe".
  10. "Curses::UI - A curses based OO user interface framework".
  11. ooRexx Documentation 5.0.0: nCurses Class Library Reference (PDF). Rexx Language Association. 2022.
  12. 1 2 3 4 Eric S. Raymond (September 1995). "ncurses: Portable Screen-Handling for Linux". Linux Journal.
  13. 1 2 3 Thomas E. Dickey (December 1996). "NCURSES - New Curses".
  14. 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
  15. "A Hacker's Guide to Ncurses Internals".
  16. Sydney S. Weinstein (April 1993). "On the Networks". C/C++ Users Journal. Archived from the original on 2014-08-11. Retrieved 2017-09-15.
  17. 1 2 3 "NCURSES - Frequently Asked Questions (FAQ): Is it GPL'd?".
  18. "Search results: +ncurses on freshmeat.net". Archived from the original on February 18, 2012. Retrieved 2013-05-10.
  19. "Projects tagged 'ncurses'". ohloh.