packages feed

ansi-terminal-0.3.1: README.textile

h1. ANSI Terminal

You can help improve this README with extra snippets and advice by using the "GitHub wiki":http://github.com/batterseapower/ansi-terminal/wikis/readme.


h2. Installing

To just install the library:

<pre>
<code>runghc Setup.lhs configure
runghc Setup.lhs build
sudo runghc Setup.lhs install
</pre>
</code>

If you want to build the example, to check it's all working:

<pre>
<code>runghc Setup.lhs configure -fexample
runghc Setup.lhs build
dist/build/ansi-terminal-example/ansi-terminal-example
</pre>
</code>


h2. Description

"ANSI":http://en.wikipedia.org/wiki/ANSI_escape_sequences terminal support for Haskell, which allows:

* Cursor movement
* Screen and line clearing
* Color output
* Showing or hiding the cursor

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":http://github.com/batterseapower/ansi-wl-pprint, which provides a pretty-printer that can construct strings containing ANSI colorisation.


h2. Example

A full example is provided with the package, and can be compiled by suppling Cabal with the @-fexample@ flag. It is also available online at "GitHub":http://github.com/batterseapower/ansi-terminal/tree/master/System/Console/ANSI/Example.hs.

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, you can see the API "here":http://github.com/batterseapower/ansi-terminal/tree/master/includes/Common-Include.hs. Each supported escape code or family of codes has a corresponding function that comes in three variants:

* A straight @IO@ variant that doesn't take a @Handle@ and just applies the ANSI escape code to the terminal attached to stdout
* An @IO@ variant similar to above, but which takes a @Handle@ to which the ANSI escape should be applied
* A @String@ variant that returns a literal string that should be included to get the effect of the code. This is the only one of the three API variants that only works on Unix-like operating systems: on Windows these strings will always be blank!


h2. Linkage

* "Hackage":http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ansi-terminal
* "Bug Tracker":http://bsp.lighthouseapp.com/projects/16235-hs-ansi-terminal
* "GitHub":http://github.com/batterseapower/ansi-terminal/