HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

GHCi in colour

Categories: Tools

This page documents efforts to colourise GHCi output.

Contents

1 Example

   Image:Colour-ghci.png

Or a type error:

   Image:Coloured-error.png

Output like this would be the result of running, for example:

   ghci --colour

and would appear in the console/xterm as ansi terminal coloured output.

2 Implementation

2.1 Using HsColour

An existing tool, HsColour, could be modified to operate interactively. In fact, HsColour is already interactive, and with a small patch added on 2006-12-14 to control ouput buffering better, this works relatively nicely:

   ghci 2>&1 | HsColour -tty
HsColour in action
HsColour in action

There are small delays however, when lexing certain tokens, and the interaction with readline isn't ideal.

2.2 GuiHaskell

Neil Mitchell has a prototype gui haskell wrapper, based on gtk. Does this contain a reasonable ghci wrapper we could steal?


If you have an idea of how to do this nicely, add your proposal here.

Retrieved from "http://haskell.org/haskellwiki/GHCi_in_colour"

This page has been accessed 931 times. This page was last modified 01:05, 15 December 2006. Recent content is available under a simple permissive license.