Ncurses
Encyclopedia
ncurses is a programming library
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 that provides an API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 which allows the programmer to write text user interface
Text user interface
TUI short for: Text User Interface or Textual User Interface , is a retronym that was coined sometime after the invention of graphical user interfaces, to distinguish them from text-based user interfaces...

s in a terminal-independent manner. It is a toolkit for developing "GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

-like" application software
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 that runs under a terminal emulator
Terminal emulator
A terminal emulator, terminal application, term, or tty for short, is a program that emulates a video terminal within some other display architecture....

. It also optimizes screen changes, in order to reduce the latency
Latency (engineering)
Latency is a measure of time delay experienced in a system, the precise definition of which depends on the system and the time being measured. Latencies may have different meaning in different contexts.-Packet-switched networks:...

 experienced when using remote shells
Unix shell
A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems...

.

History

The N in ncurses comes from the word new. This is because ncurses is a free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

 emulation (clone) of the System V Release 4.0 (SVr4) curses
Curses (programming library)
curses is a terminal control library for Unix-like systems, enabling the construction of text user interface applications.The name is a pun on the term “cursor optimization”. It is a library of functions that manage an application's display on character-cell terminals .- Overview :The curses API...

, which was itself an enhancement over the discontinued classic 4.4 BSD curses. The XSI Curses standard issued by X/Open
X/Open
X/Open Company, Ltd. was a consortium founded by several European UNIX systems manufacturers in 1984 to identify and promote open standards in the field of information technology. More specifically, the original aim was to define a single specification for operating systems derived from UNIX, to...

 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 a screen-oriented game. It originally used the termcap
Termcap
Termcap is a software library and database used on Unix-like computers. It enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text mode applications...

 library, which was used in other programs, such as the vi
Vi
vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.The original code for vi...

 editor.

The success of the BSD curses library prompted Bell Labs to release an enhanced curses library in their System III and System V Release 1 Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 systems. This library was more powerful and instead of using termcap, it used terminfo
Terminfo
Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. This library has its origins in the UNIX System III operating system....

. However, due to AT&T
AT&T
AT&T Inc. is an American multinational telecommunications corporation headquartered in Whitacre Tower, Dallas, Texas, United States. It is the largest provider of mobile telephony and fixed telephony in the United States, and is also a provider of broadband and subscription television services...

 policy regarding source-code distribution, this improved curses library did not have much acceptance in the BSD community.

pcurses

Around 1982, Pavel Curtis started work on a freeware
Freeware
Freeware is computer software that is available for use at no cost or for an optional fee, but usually with one or more restricted usage rights. Freeware is in contrast to commercial software, which is typically sold for profit, but might be distributed for a business or commercial purpose in the...

 clone of the Bell Labs curses, named pcurses, which was maintained by various people through 1986.

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 (1995), was driven by Eric S. Raymond
Eric S. Raymond
Eric Steven Raymond , often referred to as ESR, is an American computer programmer, author and open source software advocate. After the 1997 publication of The Cathedral and the Bazaar, Raymond was for a number of years frequently quoted as an unofficial spokesman for the open source movement...

, 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
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

. 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
Terminfo
Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. This library has its origins in the UNIX System III operating system....

 (with extensible data) or termcap
Termcap
Termcap is a software library and database used on Unix-like computers. It enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text mode applications...

. Other implementations of curses
Curses (programming library)
curses is a terminal control library for Unix-like systems, enabling the construction of text user interface applications.The name is a pun on the term “cursor optimization”. It is a library of functions that manage an application's display on character-cell terminals .- Overview :The curses API...

 generally use terminfo
Terminfo
Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. This library has its origins in the UNIX System III operating system....

; a minority use termcap
Termcap
Termcap is a software library and database used on Unix-like computers. It enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text mode applications...

. Few (mytinfo was an older exception) use both.

License

Ncurses is a part of the GNU Project
GNU Project
The GNU Project is a free software, mass collaboration project, announced on September 27, 1983, by Richard Stallman at MIT. It initiated GNU operating system development in January, 1984...

. It is one of the few GNU files not distributed under the GNU GPL
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

 or LGPL
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT License...

; it is distributed under a permissive free software licence
Permissive free software licence
A permissive free software licence is a class of free software licence with minimal requirements about how the software can be redistributed. This is in contrast to copyleft licences, which have reciprocity / share-alike requirements. Both sets of free software licences offer the same freedoms in...

, similar to the MIT License
MIT License
The MIT License is a free software license originating at the Massachusetts Institute of Technology . It is a permissive license, meaning that it permits reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms...

. This is due to the agreement made with the Free Software Foundation
Free Software Foundation
The Free Software Foundation is a non-profit corporation founded by Richard Stallman on 4 October 1985 to support the free software movement, a copyleft-based movement which aims to promote the universal freedom to create, distribute and modify computer software...

 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

"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.

However, because it is Free Software Foundation
Free Software Foundation
The Free Software Foundation is a non-profit corporation founded by Richard Stallman on 4 October 1985 to support the free software movement, a copyleft-based movement which aims to promote the universal freedom to create, distribute and modify computer software...

 software, they may choose to GPL it in the future.

Programs using ncurses

There are hundreds of programs which use ncurses. Some, such as GNU Screen
GNU Screen
GNU Screen is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session...

 and w3m
W3m
w3m is a free software/open source text-based web browser. It has support for tables, frames, SSL connections, color and inline images on suitable terminals...

, use only the termcap
Termcap
Termcap is a software library and database used on Unix-like computers. It enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text mode applications...

 interface, performing screen management within the application. Others, such as GNU Midnight Commander and YaST
Yet Another Setup Tool
YaST is an RPM-based operating system setup and configuration tool that is featured in the openSUSE Linux distribution, as well as Novell's derived commercial distributions. It features tools that can configure many aspects of the system. It is also part of the defunct United Linux...

 use the curses programming interface.

See also

  • SMG$
    SMG$
    SMG$ is a library of screen management routines for OpenVMS. These routines allow programs to create text-based, terminal interfaces in a terminal-independent manner. This is similar in concept to the ncurses library made popular under UNIX....

    . The Screen Management library
    Application programming interface
    An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

     available under OpenVMS
    OpenVMS
    OpenVMS , previously known as VAX-11/VMS, VAX/VMS or VMS, is a computer server operating system that runs on VAX, Alpha and Itanium-based families of computers. Contrary to what its name suggests, OpenVMS is not open source software; however, the source listings are available for purchase...

    .
  • conio
    Conio.h
    conio.h is a C header file used in old MS-DOS compilers to create text user interfaces. It is not described in The C Programming Language book, and it is not part of the C standard library, ISO C nor is it defined by POSIX....

    . A C header file used in MS-DOS compilers to create text user interfaces.
  • Curses Development Kit
  • Dialog (software)
    Dialog (software)
    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....


External links


Programming Introductions


Language bindings


Distributions and packages

  • Ncurses package for WindowsGnuWin32
    GnuWin32
    The GnuWin32 project provides native ports in the form of runnable computer programs, patches, and source code for various GNU and open source tools and software, much of it modified to run on the 32-bit Windows platform...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK