⚠️ Warning: This is a draft ⚠️

This means it might contain formatting issues, incorrect code, conceptual problems, or other severe issues.

If you want to help to improve and eventually enable this page, please fork RosettaGit's repository and open a merge request on GitHub.

{{library}} Curses is a library to draw characters on a terminal. Programs can use curses to move the terminal's cursor and display text in any line and column. For input, curses can get individual key presses from the terminal's keyboard. To optimize output, curses delays the screen updates until the program refreshes the screen.

There are at least 4 implementations of curses:

  • [[:Category:ncurses|ncurses]].
  • [http://netbsd.gw.com/cgi-bin/man-cgi?curses+3+NetBSD-current NetBSD curses].
  • [http://pdcurses.sourceforge.net/ PDCurses].
  • [http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?curses+3 System V curses].

Curses is terminal-independent, and uses ''termcap'' or ''terminfo'' to send escape sequences to different flavors of terminals. (The exception is PDCurses, which never sends escape sequences, because it uses a DOS console or a graphical interface.)

  • '''C'''
#include <curses.h>

Then link the program with <code -lcurses. (Some old or strange systems might need -lcurses -ltermlib.)

  • '''Common Lisp'''
;; After installing the quicklisp library manager
(ql:quickload :croatoan)
  • '''Ruby'''
require 'curses'
  • '''Go'''
import "github.com/gbin/goncurses"

There are a number of curses bindings for Go. This one is popular.

[[Category:Terminal control]]