The ansi-terminal package

[Tags: bsd3, library]

ANSI terminal support for Haskell: allows cursor movement, screen clearing, color output showing or hiding the cursor, and changing the title. Compatible with Windows and those Unixes with ANSI terminals, but only GHC is supported as a compiler.

[Skip to ReadMe]


Versions0.1, 0.2, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5,, 0.6, 0.6.1,, 0.6.2,,,
Dependenciesbase (<5), unix (>=, Win32 (>=2.0) [details]
AuthorMax Bolingbroke
MaintainerRoman Cheplyaka <>
CategoryUser Interfaces
Home page
Source repositoryhead: git clone git://
UploadedMon Dec 16 12:55:29 UTC 2013 by RomanCheplyaka
DistributionsDebian:, Fedora:, FreeBSD:, LTSHaskell:, NixOS:, Stackage:
Downloads166378 total (162 in last 30 days)
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]




splitbaseChoose the new smaller, split-up base packageEnabledAutomatic
exampleBuild the example applicationDisabledAutomatic

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


Maintainers' corner

For package maintainers and hackage trustees

Readme for ansi-terminal-0.6.1


Haskell ANSI Terminal Package For Windows, OS X and Linux


ANSI terminal support for Haskell, which allows:

It is compatible with Windows (via an emulation layer) and those Unixes with ANSI terminals.

If you like this, you may be interested in ansi-wl-pprint, which provides a pretty-printer that can construct strings containing ANSI colorisation.

Not all of the ANSI escape codes are provided by this module, but most (if not all) of the popular and well supported ones are. For a full list, have a look at the current version of the API. Each supported escape code or family of codes has a corresponding function that comes in three variants:


A full example is available, but for a taste of how the library works try the following code:

import System.Console.ANSI

main = do
    setCursorPosition 5 0
    setTitle "ANSI Terminal Short Example"

    setSGR [ SetConsoleIntensity BoldIntensity
           , SetColor Foreground Vivid Red
    putStr "Hello"
    setSGR [ SetConsoleIntensity NormalIntensity
           , SetColor Foreground Vivid White
           , SetColor Background Dull Blue
    putStrLn "World!"


Haddock documentation is available at Hackage.


The library is originally written by Max Bolingbroke