hscurses: NCurses bindings for Haskell

[ library, user-interface ] [ Propose Tags ] [ Report a vulnerability ]

Binding to NCurses, a library of functions that manage an application's display on character-cell terminals. Additionally, it contains some basic widgets such as a text input widget and a table widget.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
examples

Build test and example binaries

Disabled
debug

Compile with logging/tracing functions

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.2, 1.3, 1.3.0.1, 1.3.0.2, 1.4.0.0, 1.4.1.0, 1.4.1.1, 1.4.1.2, 1.4.2.0, 1.5.0.0
Change log ChangeLog
Dependencies base (>=4 && <5), exceptions (<0.11), mtl (<2.4), time (<1.13), unix (<2.9) [details]
Tested with ghc ==7.6.1 || ==7.8 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.1
License LicenseRef-LGPL
Copyright Stefan Wehr 2004 - 2011 Don Stewart 2004 Tuomo Valkonen 2004 John Meacham 2002-2004
Author John Meacham <john at repetae dot net> Tuomo Valkonen <tuomov at iki.fi> Don Stewart <http://www.cse.unsw.edu.au/~dons> Stefan Wehr <http://www.stefanwehr.de>
Maintainer Stefan Wehr <http://www.stefanwehr.de>
Category User-interface
Home page https://github.com/skogsbaer/hscurses
Source repo head: git clone https://github.com/skogsbaer/hscurses
Uploaded by kenranunderscore at 2025-01-19T09:55:28Z
Distributions NixOS:1.4.2.0
Reverse Dependencies 5 direct, 158 indirect [details]
Executables widget-test-edit, widget-test-table, widget-test-text, key-test, contact-manager
Downloads 11541 total (65 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hscurses-1.5.0.0

[back to package description]

hscurses -- A Haskell Binding to ncurses

hscurses is a Haskell binding to the ncurses library, a library of functions that manage an application's display on character-cell terminals. hscurses also provides some basic widgets implemented on top of the ncurses binding, such as a text input widget and a table widget.

The hscurses library has been reported to work on Linux x86 using GHC 6.12.1, 7.0.3, 7.2.1, and GHC major versions starting from GHC 8.4. See the GitHub actions for GHC versions that we actively test against.

Building the hscurses library

Requirements:

  • cabal-install + GHC installation
  • ncurses with headers

Build:

cabal build

The repository contains a couple of example and testing applications in the example and tests directories. To run them, you have to enable the examples Cabal flag; for instance:

cabal run -f examples widget-test-edit

or:

cabal run -f examples contact-manager -- example/contacts

In order to generate the API documentation, you need haddock. The command is then:

cabal haddock

Building and installing the hscurses library (old)

Requirements:

  • GNU m4
  • GHC >= 6.8
  • ncurses with headers

Build and installation steps:

runhaskell Setup.hs configure
runhaskell Setup.hs build
runhaskell Setup.hs install

In order to generate the API documentation, you need haddock (http://www.haskell.org/haddock). The command is then:

runhaskell Setup.hs haddock

Using the hscurses library

Just add the package hscurses to your dependencies and make sure you have an installation of ncurses. At the moment, user documentation is only available through Haddock API documentation.

For basic usage check out the code in the example and ./tests directories.

Debug logging

hscurses ships with very basic logging functionality. The default behavior is not to compile with support for this, but you can use the Cabal flag debug to manually enable this. Logs will be written to .hscurses.logs in the directory you're running the cabal command from. Example:

cabal run -f examples -f debug contact-manager -- example/contacts

Windows support

Windows support relies on pdcurses, which is already packaged for MinGW and can be installed with mingw-get.

Thanks to Jos� Romildo Malaquias (malaquias@gmail.com) for porting hscurses to the Windows platform!

There is also a detailed installation instruction by Ilan Godik: https://medium.com/@NightRa/installing-hscurses-on-windows-830532d3268a

Development notes

John Meacham <john @ repetae . net>, 2002-2004.
Tuomo Valkonen <tuomov @ iki.fi>, 2004.
Don Stewart <http://www.cse.unsw.edu.au/~dons>, 2004.
Stefan Wehr <http://www.stefanwehr.de>, 2004-2011.

History

John Meacham started the binding for his chat client Ginsu.

Tuomo Valkonen integrated to code into Riot, with minor modifications.

Don Stewart improved the code for the Yi editor.

Stefan Wehr turned the binding into a standalone library. He also added some basic widgets.