Fact-checked by Grok 2 weeks ago

ncurses

ncurses is a free software library providing an application programming interface (API) for the creation of text-based user interfaces (TUIs) in a manner independent of the underlying terminal hardware or emulator. It originated as an open-source implementation and enhancement of the original System V Release 4.0 (SVr4) curses library, which itself was designed to simplify the control of cursor positioning and screen updates on character-cell terminals by abstracting terminal-specific escape sequences. Developed through contributions from multiple programmers starting in the early , ncurses achieved full compatibility with SVr4 curses by version 1.8.5 and has since been maintained primarily by Thomas E. Dickey, who took over in 1996 and continues to oversee its evolution, including ports to platforms like Win32 consoles via since 2008. The library is distributed under open-source licenses, ensuring its free availability and redistribution, and it relies on the database—a successor to —for describing capabilities, allowing applications to adapt to a wide range of devices without modification. Key capabilities of ncurses include functions for initializing and managing screens, creating and manipulating windows and ( screens larger than the physical ), handling input without echoing, supporting color attributes, and enabling interactions where supported by . It extends the original curses with features like resizable windows, advanced color handling, and optional add-on libraries for panels, menus, and forms, making it suitable for building complex console applications such as text editors, system utilities, and interactive tools in environments. Widely used in projects requiring portable interfaces, ncurses remains actively developed, with the latest stable release being version 6.5 (April 2024, with patches through October 2025) incorporating updates for modern terminals and requiring version 6.2 or higher for full support.

Overview

Purpose and Scope

ncurses is a library that emulates the System V Release 4.0 curses , offering a set of functions for controlling screens, managing windows, and handling input in text-based environments. As a programming library, it enables the creation of text user interfaces (TUIs) by abstracting differences between various terminal types, allowing developers to build portable applications that run consistently across systems and other platforms supporting terminal emulation. The primary goals of ncurses include achieving terminal independence, which simplifies TUI development by hiding the complexities of terminal-specific behaviors, and providing support for advanced features such as color manipulation, input, and event mapping. It wraps low-level terminal escape sequences into high-level functions, presenting a simplified screen model to programmers while optimizing output for efficient updates between screen states. This ensures that applications can focus on interface logic rather than hardware-specific details, fostering portability and ease of use in command-line environments.

Compatibility and Standards

ncurses provides full compatibility with the System V Release 4 (SVr4) curses API, implementing all 257 standard functions, including core routines such as initscr() for screen initialization, refresh() for updating the display, and getch() for input handling. This ensures that applications written for SVr4 curses can be ported to ncurses with minimal or no modifications, maintaining behavioral fidelity in terminal control and screen management. The library extends this foundation by supporting XSI Curses extensions as defined in the X/Open Portability Guide version 4 (XPG4), achieving BASE-level conformance with full EXTENDED functionality, including color manipulation via functions like init_pair() for defining color pairs and wide-character support through the ncursesw variant, which handles wchar_t for . These extensions enable advanced features like colored output and text rendering while preserving the standard API's integrity. For with older BSD curses variants, ncurses employs conditional compilation and feature test macros, such as NCURSES_WIDECHAR, allowing developers to target legacy behaviors during builds and ensuring recompilation suffices for most BSD-derived code without source changes. This approach positions ncurses as the approved replacement for discontinued 4.4BSD curses, supporting resizable windows and other enhancements absent in classic BSD implementations. ncurses conforms to POSIX standards for terminal handling where applicable, such as in input/output operations and signal management, with non-standard extensions clearly demarcated—often prefixed in headers or guarded by macros like _XOPEN_SOURCE to avoid conflicts in portable code. This partial alignment facilitates deployment on -compliant systems while marking ncurses-specific functions, like those in the ncurses.h header, to maintain .

History

Origins in Curses

The original curses library emerged in the late 1970s at the , as part of the development of the ex editor—later evolved into —within the early (BSD) versions of Unix, specifically 3BSD. This library was initially crafted to provide a reusable set of routines for managing text-based user interfaces on character-cell terminals, building upon existing terminal description mechanisms like . Ken Arnold, a student and key contributor to BSD projects, is credited with developing the core curses implementation, enhancing preliminary screen-handling code from Bill Joy's ex editor to create a more generalized library. The primary goal was to optimize screen updates on slow (CRT) terminals, such as the , by minimizing cursor movements and redrawing only changed portions of the display, thereby improving efficiency in resource-constrained environments. This approach addressed the challenges of early Unix systems where full-screen redraws could be prohibitively slow. Over the subsequent years, curses evolved within the BSD lineage, with significant refinements appearing in 4.2BSD, where reorganized termcap functions around a to support multiple screen regions. By the time of 4.4BSD in the early , the library had introduced rudimentary support for overlapping windows, allowing developers to create layered interfaces, though this feature suffered from portability issues across different terminal types and lacked robust management for updates in overlapping areas. These limitations stemmed from its tight coupling with BSD-specific terminal capabilities, hindering widespread adoption beyond academic and research settings. In the 1980s, incorporated and adapted BSD curses into its proprietary , beginning with Release 2 in 1984, where it standardized the application programming interface () while replacing with the more efficient database. This version, distributed commercially by , established curses as a for terminal handling but restricted free redistribution and source access, prompting the need for open alternatives like ncurses in later years.

Development of pcurses and ncurses

pcurses originated in 1982 as a freeware implementation of the curses library, developed by Pavel Curtis to provide portability across PCs and non-Unix systems, addressing limitations in the proprietary versions available at the time. The project was maintained by various contributors through 1986, focusing on basic terminal control features while remaining in the public domain after Curtis relinquished his copyright. In 1993, Zeyd M. Ben-Halim revived and polished the pcurses codebase, porting it to and reissuing it as ncurses version 1.8.1 in November of that year, with significant contributions from starting around the same time. This evolution built briefly on the foundations of the original curses library from the BSD and System V eras, but emphasized open-source accessibility as a response to proprietary restrictions. The initial development aimed for free distribution under a permissive allowing reproduction and use with minimal restrictions, provided notices were retained, aligning closely with MIT-style terms. Key goals included achieving full compatibility with System V Release 4 (SVr4) curses specifications, extending the terminal capabilities database to match 456 SVr4 entries while adding new ones for broader support. Developers also prioritized filling gaps in the original implementation, such as enhanced color support—ncurses introduced handling for up to 16 colors from its inception, surpassing SVr4's limit of 8—to enable more vibrant text user interfaces on capable terminals. Early releases like ncurses 1.8.1 incorporated core screen and window abstractions from the public-domain pcurses base, with initial bug fixes, ANSI prototypes, and reformatting to improve maintainability and portability. Subsequent versions through 1.8.8, driven primarily by , refined these elements but retained the focus on SVr4 conformance without venturing into extended libraries at that stage.

Major Releases and Maintenance

In 1996, Thomas E. Dickey assumed maintenance of ncurses, building on earlier work and expanding its portability to numerous systems, including distributions, Windows consoles via the port introduced in version 5.8, and various platforms. Key milestones include the release of ncurses 5.0 in February 2007, which introduced initial wide-character support, handling, and enhancements to the terminal database for better performance and portability. Subsequent major updates arrived with ncurses 6.0 in January 2015, featuring ABI version 6, improved processing, RGB color support, and a new binary format to enhance compatibility with modern environments. The ncurses 6.5 release in April 2023 marked ABI 7, with improvements in performance, support for user-defined terminal capabilities, and extended mouse button handling. Development relies on community contributions through the ncurses mailing list and Git repositories hosted on Savannah, where developers submit patches for integrating new terminal types and resolving bugs. These efforts ensure regular maintenance releases that address compatibility issues and refine terminfo entries for evolving hardware and software. As of 2025, ncurses remains under active development, with ongoing priorities including security enhancements, IPv6 support in utilities like tac and tput, and improved compatibility with contemporary terminals such as those in Wayland compositors, foot, and wezterm, as evidenced by updates like terminfo adjustments in November 2025.

Technical Details

Terminal Database (Terminfo)

The terminfo system serves as ncurses' core mechanism for abstracting terminal capabilities, providing a compiled database of descriptions for various terminals that enables portable screen-oriented applications. Unlike the earlier format, terminfo stores precompiled binary entries detailing attributes such as color support, key mappings, and control sequences like escape codes for cursor movement and screen clearing. Each entry corresponds to a specific terminal type, allowing programs to query and utilize hardware-specific behaviors without hardcoding them. Terminfo entries are structured as binary files typically located in /usr/share/terminfo/, organized hierarchically by the first letter of the terminal name followed by subdirectories (e.g., /usr/share/terminfo/x/xterm-256color for the xterm terminal with 256-color support). These binaries are generated by the tic compiler from human-readable source files with .ti extensions, which define capabilities in a comma-separated format including booleans (e.g., am for automatic margins), numerics (e.g., colors#256 for color count), and strings (e.g., cup=\E[%i%p1%d;%p2%dH for parameterized cursor addressing). The database supports a search path that first checks the TERMINFO environment variable if set (to a directory or file path), then the directories listed in the TERMINFO_DIRS environment variable if set, followed by $HOME/.terminfo, and finally the compiled-in system directories (e.g., /lib/terminfo, /usr/share/terminfo). Ncurses provides low-level functions to interact with the terminfo database, facilitating initialization and capability retrieval for terminal control. The setupterm() function initializes the database by loading the entry for the specified terminal type (defaulting to the TERM environment variable) and file descriptor, setting up variables for subsequent operations; for example, setupterm((char *)0, 1, (int *)0) configures stdout for the current terminal. String capabilities are fetched using tigetstr(), which returns a pointer to the capability string (e.g., tigetstr("clear") yields the screen-clearing sequence) or null indicators for absence or invalid types. Parameterized strings, common for dynamic outputs like cursor positioning, are instantiated via tparm(), substituting variables into the format; for instance, tparm(tigetstr("cup"), 10, 20) generates the to move the cursor to row 10, column 20. These functions underpin ncurses' screen and window abstraction by supplying the terminal-specific primitives needed for higher-level rendering. Ncurses extends with support for user-defined capabilities, enabling customization for non-standard or modern terminals beyond the standard repertoire. Developers define these in source files using names prefixed with + or via the -x option in tic, allowing booleans, numerics, or strings for features like extended key codes; once compiled, they integrate seamlessly into the database. This feature, introduced in ncurses 5.0, maintains full compatibility with System V Release 4 (SVr4) curses while adding enhancements for contemporary hardware, such as improved handling of wide-character locales and variable-argument parameterization in functions like tiparm().

Screen and Window Abstraction

The ncurses library provides a high-level for manipulation through the SCREEN , which serves as the top-level of the physical device. This opaque encapsulates the 's state, including file descriptors and terminfo-derived capabilities, and is initialized using the newterm() function, which allocates necessary data structures and sets up signal handlers for the specified type. The SCREEN pointer returned by newterm() must be preserved for subsequent operations, enabling multiple support within a single application while ensuring terminal-independent behavior. At a lower level, ncurses employs structures to model logical rectangular regions of the screen, each maintaining an internal grid of characters with associated attributes such as bold (A_BOLD), underline (A_UNDERLINE), and color pairs defined via init_pair(). These structures support output operations like addch() for placing individual characters at the current cursor position and mvaddstr() for moving the cursor and adding strings, with attributes applied to enhance readability without direct escape sequence management. To update the physical display, applications call refresh() on a , which computes the minimal changes required based on capabilities and outputs them efficiently, handling overlapping windows by redrawing only affected areas to prevent visual artifacts. For scenarios requiring display areas larger than the physical , ncurses introduces as specialized WINDOW-like structures created via newpad(), allowing screens that exceed dimensions. Unlike windows, do not automatically refresh; instead, pnoutrefresh() specifies a source from the pad and a destination on the screen for partial updates, enabling efficient scrolling and viewing of oversized content without full repaints. Input abstraction in ncurses is managed through functions like getch(), which reads characters or events from the associated WINDOW or SCREEN, blocking until input arrives unless non-blocking mode is set. Enabling keypad mode via keypad(stdscr, TRUE) maps special keys—such as (KEY_UP, KEY_DOWN) and keys (KEY_F1)—to portable KEY_ constants, independent of the underlying 's escape sequences, by leveraging mappings for consistent behavior across devices.

Features

Core Functionality

The core functionality of ncurses revolves around providing a portable API for initializing terminal environments, handling input and output operations, and managing basic screen updates in text-based user interfaces. Central to this is the initialization process, which begins with the initscr() function. This function sets up the curses environment by allocating memory for the standard screen (stdscr), determining the terminal type from the TERM environment variable, and switching the terminal into a mode suitable for curses operations, such as enabling the keypad and initializing color support if available. For more control, newterm() allows initialization with a specific input/output file descriptor and terminal description, enabling multiple terminal sessions within a single program. Upon completion, programs must call endwin() to restore the terminal to its original state, free allocated resources, and reset tty modes, ensuring proper cleanup and preventing issues like lingering cursor visibility or mode mismatches. Input modes are configurable to suit different interaction needs, with raw() disabling line buffering and special character processing to pass all input directly to the application, while cbreak() achieves similar unbuffered input but retains for visible keystrokes. Non-blocking input can be enabled via nodelay() on a window, causing wgetch() to return ERR immediately if no input is available, or through halfdelay(), which sets a timeout in tenths of seconds (1 to 255) before switching to blocking mode, allowing timed polls without busy-waiting. Echo control is managed with echo() to enable or disable automatic printing of input characters, and noecho() for silent input, which is essential for fields or custom interfaces. Mouse support is integrated via mousemask(), which specifies events like button presses, releases, or drags to track, returning a mask of enabled events; subsequent calls to getmouse() retrieve details such as position and button state for handling clicks and movements. Output operations focus on efficient text rendering and cursor control. Functions like move(y, x) position the logical cursor at the specified row and column on a , while insch(ch) inserts a at the current position, shifting subsequent content rightward to support dynamic updates without full redraws. Attributes are applied using attron(attr) to enable features like bold or underline, and color_set(pair) to activate a predefined foreground-background color pair, with changes affecting subsequent output until turned off. Screen updates are buffered for optimization: modifications to windows populate a virtual screen, and refresh() or wrefresh(win) computes the differences against the physical state, issuing only necessary escape sequences to minimize flicker and , particularly in slow connections. Standard utilities provide essential control over the display and audio feedback. clear() erases the entire window and positions the cursor at the top-left, optimizing for full redraws, whereas erase() clears content but leaves trailing spaces intact for partial updates. The beep() function emits an audible alert if supported by the terminal, with flash() offering a visual screen flash as an alternative. Color handling extends to advanced palettes via init_color(color, r, g, b), which redefines one of the 16 basic colors using RGB values (0-1000 scale) on terminals that support it, enabling 256-color modes when combined with start_color() and extended terminfo entries. Additionally, use_default_colors() allows integration of the terminal's default foreground and background colors into the palette by assigning -1 to a color pair, preserving system themes without hardcoding. These primitives abstract terminal variations through a window-based model, where stdscr serves as the default full-screen window for operations.

Extensions and Libraries

Ncurses extends the foundational curses API with specialized libraries that address limitations in managing complex text-based user interfaces (TUIs), particularly for overlapping elements, hierarchical navigation, and data input. These extensions, including the panel, menu, and form libraries, were developed to provide more sophisticated abstractions while maintaining compatibility with System V Release 4 (SVr4) curses standards. They enable developers to build advanced applications such as dialog boxes, selection menus, and interactive forms without manual handling of low-level terminal interactions. The panel library introduces support for overlapping windows, a capability absent in traditional curses implementations that primarily handle non-overlapping (tiled) displays. It maintains a of panels, each associated with a curses , allowing automatic management of visibility and based on depth ordering. Developers create panels using new_panel(WINDOW *win), which inserts a window into the stack, and manipulate the order with functions like top_panel() or bottom_panel(). To render the stack correctly, update_panels() must be called before doupdate(), ensuring that obscured regions are properly obscured while preserving backing store for hidden content. This resolves historical weaknesses in curses by eliminating the need for programmers to manually track and redraw overlapping areas, which could lead to inefficiencies or visual artifacts in TUIs. The facilitates the creation of hierarchical menu systems, extending basic curses input handling to support selectable items and navigation. It consists of item routines for defining menu options (e.g., new_item(const char *name, void *userptr)), menu routines for grouping items (e.g., new_menu(ITEM **items)), and driver routines for processing user input. The core function menu_driver(MENU *menu, int c) interprets keystrokes or events, handling actions like item selection, scrolling, and navigation while respecting menu attributes such as single- or multiple-column layouts and marking styles. This supports and input uniformly, making it suitable for interactive applications like selectors or dialogs. Similarly, the form library enables the design of structured input forms composed of fields, addressing the limitations of raw curses for data validation and dynamic layouts. Field routines allow creation of input areas (e.g., new_field(int height, int width, int frow, int fcol, int nrows, int ncols)), with options for types like numeric, alphabetic, or regular expression validation via set_field_type(FIELD *field, FIELDTYPE *type). Forms are assembled by linking fields (e.g., new_form(FIELD **fields)), and form_driver(FORM *form, int c) processes user interactions, moving focus between fields, validating entries, and applying dynamic adjustments like field growth or buffering. This provides a high-level interface for applications requiring user data entry, such as editors or setup wizards, without custom parsing logic. Beyond these libraries, ncurses includes several non-standard extensions for enhanced display and input capabilities. Wide-character support, available through the ncursesw variant, accommodates via the wchar_t type and functions like wadd_wch(), enabling in TUIs on terminals supporting UTF-8. The alternate character set (ACS) provides predefined constants (e.g., ACS_VLINE for vertical lines) for box-drawing and simple graphics, mapped to terminal-specific glyphs via , which improves rendering of borders and separators without relying on Unicode fallbacks. Additionally, ripoffline(int nlines, int (*init)(WINDOW *, int)) reserves lines at the screen's top or bottom for persistent status or error messages, automatically invoked during screen initialization to support real-time feedback in long-running applications.

Licensing and Distribution

License Terms

ncurses originated under a permissive MIT-style license introduced by its initial developer, Zeyd M. Ben-Halim, in the 1993 release (version 0.7.2), building upon the pcurses library created by Pavel Curtis in 1982. This early license permitted reproduction and distribution with attribution but reserved other rights, later evolving as contributions from (starting in 1995) and Thomas E. Dickey (from 1995) introduced X11/ variants that relaxed restrictions on modification while emphasizing notice retention. The integration of components from pcurses added complexity to early releases, as Curtis relinquished his copyright in 1994, allowing their free reuse. By 1998, with ncurses version 4.2, the project adopted the MIT-style license to address prior ambiguities, particularly around explicit rights to modify and redistribute, which had prompted to deem earlier versions non-free software and remove them from distributions in 1997. This shift unified disparate terms from contributors under a single permissive framework, ensuring broad usability. As of 2025, ncurses remains under this FSF-permissive , which authorizes any person to use, , modify, merge, publish, distribute, sublicense, and sell the software without obligations, provided the notice and permission notice are included in all copies or substantial portions. The COPYING file in distributions specifies no of any kind, including merchantability or fitness for a particular purpose, and holds holders harmless from arising from use. Commercial use is explicitly permitted, with no fees required beyond nominal handling in early contexts. Key clauses emphasize attribution to original authors via notice preservation and prohibit using the names of copyright holders (such as the FSF or individual contributors) in or without prior written consent. The license's permissive structure ensures compatibility with (GPL) projects, allowing unrestricted static or dynamic linking, as confirmed by FSF guidelines for X11/ licenses. In the ncurses 6.x series (from version 6.0 in 2016 onward), ongoing maintenance has further clarified and preserved these terms, solidifying compliance with standards by reassigning copyrights where needed and avoiding restrictive clauses.

Portability Across Platforms

ncurses provides native support for operating systems, including , BSD variants, and , primarily through its database, which describes capabilities for accurate rendering and input handling across diverse environments. This integration extends to graphical display systems such as X11 and , where ncurses interfaces with emulators like or modern compositors via standard protocols, as well as direct console modes on systems like the virtual console. The library emulates System V Release 4 UNIX curses and adheres to XPG4 standards, ensuring consistent behavior on these platforms without requiring platform-specific modifications. For Windows environments, ncurses offers ports through and , allowing compilation and execution on native Win32 consoles with adaptations for Windows-specific I/O and emulation. These ports enable cross-compilation from hosts, maintaining core functionality while accommodating Windows' lack of a native system by using fallback mechanisms. In embedded systems, ncurses supports reduced-footprint builds suitable for resource-constrained devices like microcontrollers, achieved through static linking to eliminate dynamic dependencies and minimal configurations that include only essential descriptions. Configuration options allow stripping unnecessary features, such as wide-character support or extended color palettes, resulting in binaries optimized for environments with limited memory and storage. The build system relies on for automated configuration, detecting platform-specific features like compiler capabilities, library paths, and hardware architectures to generate tailored Makefiles. This setup facilitates support for both 32-bit and 64-bit architectures, as well as big-endian byte orders common in certain or cross-compiled targets, ensuring portability without manual adjustments. The permissive MIT-like further enables these adaptations by allowing unmodified redistribution in or contexts.

Usage

Programming with ncurses

To compile and link a program using ncurses, include the header <ncurses.h> and use the flag -lncurses during linking, such as [gcc](/page/GCC) program.c -lncurses. For programs requiring wide-character support (e.g., for and ), configure ncurses with --enable-widec during build and link against the wide-character variant using -lncursesw, while still including <ncurses.h>; this provides functions like add_wch for wide-character output. A basic ncurses program follows a standard structure: initialize with initscr() to enter curses mode and set up the default window stdscr; configure input handling with calls like cbreak(), noecho(), and keypad(stdscr, TRUE); create additional windows using newwin(nlines, ncols, begin_y, begin_x) if needed; enter an input loop with getch() to read keystrokes; update the display via refresh() for stdscr or wrefresh(win) for other windows; and terminate with endwin() to restore the terminal and free resources. Error handling is essential, as most ncurses functions return ERR (typically -1) or NULL on failure (e.g., due to memory allocation issues or invalid parameters), so check return values explicitly and use system functions like perror() for additional diagnostics.
c
#include <ncurses.h>

int main() {
    if (initscr() == [NULL](/page/Null)) {  // Error check for initscr
        perror("initscr failed");
        [return](/page/Return) 1;
    }
    cbreak();
    noecho();
    keypad(stdscr, TRUE);

    printw("Hello, ncurses!");  // Output to stdscr
    refresh();  // [Update](/page/Update) screen

    getch();  // Wait for input

    endwin();  // Terminate
    [return](/page/Return) 0;
}
Best practices enhance efficiency and portability: use pads created with newpad(nlines, ncols) for handling content larger than the screen, scrolling via prefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol) to avoid redrawing entire areas; manage attributes (e.g., bold or color) with attron(A_BOLD) before printing and attroff(A_BOLD) after to minimize flicker, or use attrset() for temporary changes, always pairing with init_pair() for colors; and test by comparing capabilities with infocmp term1 term2 to identify differences in features like color support. For debugging, enable tracing with trace(level) where a nonzero level logs function calls and internal state to a file named "trace", allowing inspection of rendering and input behavior; compile with -lncurses_g for additional debug symbols if available. Utilities like clear (invoked as clear or via erase() in code) reset the screen, tput clear tests terminal reset capabilities, and tput in general queries or sets terminfo properties for manual verification of features like cursor movement.

Notable Applications and Bindings

Ncurses has been widely adopted in various C and C++ applications for creating terminal-based user interfaces. The Vim text editor relies on ncurses for its terminal interface, enabling efficient screen manipulation and input handling in console environments. Lynx, a text-based web browser, uses ncurses to render pages and manage navigation within character-cell displays. The htop system monitor is built as an ncurses-based interactive process viewer, providing scrollable views of system resources and real-time updates. Midnight Commander (mc), a dual-pane file manager, employs ncurses for its versatile text interface, supporting operations like file viewing and editing across consoles. Similarly, the Mutt email client compiles against ncurses to deliver a curses-based interface for mail composition and management. Bindings for ncurses extend its usability to other programming languages, often mapping the core C API to idiomatic constructs while preserving terminal independence. In , the built-in _curses module (accessible via the curses wrapper) provides direct bindings to ncurses functions; it is included in standard Python installations on systems and supports wide-character handling through curses.wrapper() for safe initialization and cleanup. For , the Curses::UI framework offers an object-oriented layer atop ncurses, enabling widget-based s like buttons and text areas; installation occurs via with cpan Curses::UI, and it abstracts screen updates through methods like draw(). Ruby's curses gem (formerly in the standard library) wraps ncurses for text development, installable via gem install curses, and maps constants like COLORS and functions such as addstr to Ruby modules for color and input management. In , the ncurses crate serves as a thin, low-level wrapper, added to projects via Cargo.toml with [dependencies] ncurses = "6.0", exposing unsafe bindings to ncurses primitives like initscr() while recommending safe abstractions for production use. Ncurses also powers tools in embedded systems and distributions, enhancing portability in resource-constrained environments. , a multi-tool suite for minimalistic systems, includes applets configurable with ncurses support for menu-driven interfaces during builds, such as menuconfig. Package managers like Debian's utilize ncurses for its full-screen TUI, allowing interactive package selection and resolution of dependencies. Games such as NetHack leverage ncurses for their curses interface, enabling colored, mouse-supported gameplay in terminals via compilation flags like windowtype=curses. The ncurses distribution includes a dedicated ncurses-examples package, featuring community-contributed and test programs that showcase advanced features. These examples demonstrate practical implementations, including dialog boxes via the forms library, progress bars with attron(A_REVERSE), and multi-threaded applications using overlays for layered windows, serving as references for developers integrating ncurses in custom tools.

References

  1. [1]
    NCURSES – New Curses - invisible-island.net
    Thomas Dickey is the maintainer/developer of ncurses. This page gives some background and pointers to ncurses resources.Announcing ncurses 6.5 · Ncurses-examples · Install · FAQ
  2. [2]
    Introduction - The Linux Documentation Project
    NCURSES is a clone of the original System V Release 4.0 (SVr4) curses. It is a freely distributable library, fully compatible with older version of curses.
  3. [3]
    ncurses(3x) - Linux manual page - man7.org
    The ncurses library extends the fixed set of function key capabilities of terminals by allowing the application designer to define additional key sequences at ...
  4. [4]
    Announcing ncurses 4.0
    The ncurses (new curses) library is a freeware emulation of System V Release 4.0 curses. It uses terminfo format, supports pads and color and multiple ...
  5. [5]
    Writing Programs with NCURSES - invisible-island.net
    The curses package is a subroutine library for terminal-independent screen-painting and input-event handling which presents a high level screen model to the ...
  6. [6]
    6.3. Ncurses-6.3 - Linux From Scratch!
    The Ncurses package contains libraries for terminal-independent handling of character screens. Approximate build time: 0.7 SBU. Required disk space: 50 MB. 6.3.
  7. [7]
    Announcing ncurses 6.5 - invisible-island.net
    The ncurses package is fully upward-compatible with SVr4 (System V Release 4) curses: All of the SVr4 calls have been implemented (and are documented). ncurses ...
  8. [8]
    ncurses(3X) - Arch manual pages
    Apr 27, 2024 · In many behavioral details not standardized by X/Open, ncurses emulates the curses library of SVr4 and provides numerous useful extensions.
  9. [9]
    ncurses -- CRT screen handling and optimization package
    The ncurses routines emulate the curses library of System V Release 4 UNIX, and the XPG4 curses standard (XSI curses) but the ncurses library is freely ...
  10. [10]
    NCURSES — Frequently Asked Questions (FAQ) - invisible-island.net
    Mar 16, 2022 · The ncurses (and ncursesw) library provide some extended functions not found in SVr4/XPG4. A few implementations (PDCurses and NetBSD curses) ...
  11. [11]
    _POSIX_C_SOURCE & _XOPEN_SOURCE standards conformance ...
    Nov 13, 2016 · Does code that includes ncurses header files need to be compiled with those levels of standards conformance macros defined that way? Or should ...ncurses 6.5 - GNU mailing listsncurses 5.8 - GNU mailing listsMore results from lists.gnu.org
  12. [12]
    NCURSES – Licensing - invisible-island.net
    The copyright notice was updated to add Eric Raymond, who had been involved in development since 1993. ... Zeyd Ben-Halim; Thomas Dickey; Eric S. Raymond ...
  13. [13]
    curs_attr 3x 2025-08-23 ncurses 6.5 Library calls - invisible-island.net
    In ncurses, they return ERR if win is NULL. wcolor_set returns ERR if pair ... Regarding UWIN, o Development of the curses library began in 1991, stopped in 2000.
  14. [14]
    Change-Log for NCURSES - invisible-island.net
    ... ncurses release. 20211018 + check for screen size-change in scr_init() and ... curses-h configure option (suggested by Reuben Thomas). 20110903 + ...Missing: maintenance | Show results with:maintenance
  15. [15]
    terminfo(5) — ncurses-bin — Debian testing
    Except for YI, the ncurses termcap names for them are invented. According to the XSI Curses standard, they have no termcap names. If your compiled terminfo ...
  16. [16]
    curs_terminfo(3x) - Linux manual page - man7.org
    The high-level curses functions initscr and newterm call setupterm to initialize the low-level set of terminal-dependent variables [listed in termin‐ fo(5)].
  17. [17]
    curs_terminfo 3x 2025-10-04 ncurses 6.5 Library calls
    These lower-level functions of the curses standard must be called by programs that deal directly with the terminfo database to handle certain terminal ...
  18. [18]
    user_caps(5) - Linux manual page - man7.org
    In SVr4 curses and ncurses, the terminal database is defined at compile-time using a text file which lists the different terminal capabilities. In principle ...Missing: initial goals
  19. [19]
    user_caps 5 2025-08-16 ncurses 6.5 File formats - invisible-island.net
    ... terminfo.src, the section "NCURSES USER-DEFINABLE CAPABILITIES". summarizes commonly-used user- defined capabilities employed in the terminal descriptions.
  20. [20]
    newterm(3ncurses) — ncurses-doc — Debian unstable
    ncurses establishes signal handlers when a function that initializes a SCREEN, either initscr or newterm, is first called. Applications that wish to handle ...
  21. [21]
    curs_getch 3x 2025-08-16 ncurses 6.5 Library calls
    Call keypad(3x) on a window to configure keypad mode when reading input from it. In keypad mode, curses treats key strokes not from the alphabetic section of ...
  22. [22]
    curs_initscr 3x 2025-08-23 ncurses 6.5 Library calls
    ... ripoffline(3x) to reserve up to five lines at the top and/or bottom of the screen from management by stdscr, the standard curses window; and o use_env(3x) and/ ...<|control11|><|separator|>
  23. [23]
  24. [24]
  25. [25]
    Announcing ncurses 6.3 - invisible-island.net
    Oct 21, 2021 · ncurses provides these SVr4 add-on libraries (not part of X/Open Curses):. the panels library, supporting a stack of windows with backing store.
  26. [26]
    menu 3x 2024-12-28 ncurses 6.5 Library calls - invisible-island.net
    The menu library provides terminal-independent facilities for composing menu systems on character-cell terminals. The library includes: item routines, which ...
  27. [27]
    menu_driver 3x 2025-10-04 ncurses 6.5 Library calls
    Once a menu has been posted (displayed), you should funnel input events to it through menu_driver. This routine has three major input cases: o The input is a ...
  28. [28]
    form 3x 2024-12-28 ncurses 6.5 Library calls
    The form library provides terminal-independent facilities for composing form screens on character-cell terminals. The library includes: field routines, which ...
  29. [29]
    ncurses 3x 2025-10-04 ncurses 6.5 Library calls - invisible-island.net
    The "new curses" library offers the programmer a terminal-independent means of reading keyboard and mouse input and writing to character-cell displays.
  30. [30]
    terminfo 5 2025-08-16 ncurses 6.5 File formats - invisible-island.net
    Many terminals have alternate character sets useful for forms-drawing. Terminfo and curses have built-in support for most of the drawing characters ...
  31. [31]
    curs_kernel 3x 2025-08-16 ncurses 6.5 Library calls
    X/Open Curses specifies ripoffline as returning OK with no possibility of failure ("[c]alls to ripoffline above this limit [five lines] have no effect but ...
  32. [32]
  33. [33]
    terminfo.src for NCURSES - invisible-island.net
    The ncurses terminfo library can # handle this case with the <ich1> ... Functions" and # "Table 5-15 (Cont.) Visual Character Attribute Values" # in EK ...
  34. [34]
    ncurses - Using curses with Linux console
    Jul 26, 2011 · ncurses uses VT100-style line drawing, but Linux console may not support it, especially in UTF-8 mode, causing characters instead of graphics.
  35. [35]
    Cross-compiling for MinGW - invisible-island.net
    The ports for vile, lynx, and ultimately ncurses, use native I/O. For example, Windows provides platform-specific functions which can be used to support these ...
  36. [36]
    PDCurses for Windows console
    PDCurses for Windows console is source code for Windows console, supporting Windows 95-11. Build with make using makefile for your compiler.Missing: ncurses integration
  37. [37]
  38. [38]
    Install-Notes for NCURSES - invisible-island.net
    You will need the following to build and install ncurses under UNIX: ANSI C compiler (gcc, for instance), sh (bash will do), awk (mawk or gawk will do), sed, ...
  39. [39]
    Statically link ncurses to program - Stack Overflow
    Aug 18, 2010 · If you want to link with the static version (.a) of ncurses rather than the dynamic version (.so) then temporarily remove the symlink for ...terminfo - How does ncurses search for terminal descriptionsHow to build ncurses statically - Stack OverflowMore results from stackoverflow.comMissing: minimal | Show results with:minimal
  40. [40]
    Cross-Compiled Linux From Scratch - CLFS
    Additionally, during a CLFS build, you will learn advanced techniques such as cross-build toolchains, multilib support (32 & 64-bit libraries side-by-side), ...
  41. [41]
    NCURSES Programming HOWTO - invisible-island.net
    This document is intended to be an "All in One" guide for programming with ncurses and its sister libraries.
  42. [42]
    tic 1m 2025-10-04 ncurses 6.5 User commands - invisible-island.net
    In early development of ncurses (1993), Zeyd Ben-Halim used the table from mytinfo to extend the pcurses table to 469 capabilities (456 matched SVr4, 8 were ...
  43. [43]
    Vim and Ncurses: Building Fast, Portable Terminal Interfaces
    Ncurses is the library that gives Vim its terminal interface. It handles windows, colors, and keyboard input without the GUI. When you run Vim in a terminal, ...
  44. [44]
    Lynx - Debian Wiki
    Nov 15, 2023 · Ncurses. Text-mode WWW Browser. Lynx is a fully-featured World Wide Web (WWW) client for users running cursor-addressable, character-cell ...
  45. [45]
    htop - an interactive process viewer
    This is htop, a cross-platform interactive process viewer. It is a text-mode application (for console or X terminals) and requires ncurses.
  46. [46]
    Midnight Commander
    Midnight Commander Development Center. ... mc uses versatile text interface libraries such as ncurses or S-Lang. This ...MC(1) · Skin Editor · Source code · Maintainers
  47. [47]
    The Mutt E-Mail Client
    compiles against either curses/ncurses or S-lang; translation into at least ... Mutt was originally written by Michael Elkins but is now developed and maintained ...Downloading Mutt · Manual · Mutt Release Notes · Mutt 1.12 Release Notes
  48. [48]
    curses — Terminal handling for character-cell displays — Python ...
    Get a wide character. Return a character for most keys, or an integer for function keys, keypad keys, and other special keys. In no-delay mode, raise an ...<|control11|><|separator|>
  49. [49]
    Curses::UI - A curses based OO user interface framework - MetaCPAN
    Curses::UI is an object-oriented user interface framework for Perl. It contains basic widgets (like buttons and text areas), more advanced widgets.
  50. [50]
    ncurses - crates.io: Rust Package Registry
    Jul 12, 2024 · A very thin wrapper around the ncurses TUI lib. NOTE: The ncurses lib is terribly unsafe and ncurses-rs is only the lightest wrapper it can be.
  51. [51]
    install ncurses on busybox
    Jan 12, 2010 · ... ncurses > first. So I compiled and installed ncurses 5.7 with same toolchain used for > compiling busybox. > When I tried to run htop I got ...[PATCH] kconfig/lxdialog: fix check sample for gcc14 - BusyBox[Bug 6920] New: Compiling busybox (make menuconfig) if ncurses ...More results from lists.busybox.net
  52. [52]
    NetHack 3.6.2: Release Notes
    It is available and tested for 3.6.2 for Windows console with PDCurses layered underneath, and for Mac OSX and Unix (using ncurses as the layer underneath). It ...
  53. [53]
    NCURSES – Test/Sample Programs - invisible-island.net
    These are generated from the main ncurses source tree, with a script make-tar.sh that is run when producing snapshots. stable release of ncurses-examples ...