Difference between revisions of "GHCi in colour"

From HaskellWiki
Jump to navigation Jump to search
(note this is already kinda possible with HsColour)
(+image)
Line 25: Line 25:
   
 
ghci 2>&1 | HsColour -tty
 
ghci 2>&1 | HsColour -tty
  +
  +
[[Image:Tty.png|frame|HsColour in action]]
  +
  +
There are small delays however, when lexing certain tokens, and the
  +
interaction with readline isn't ideal.
   
 
=== GuiHaskell ===
 
=== GuiHaskell ===

Revision as of 01:05, 15 December 2006

This page documents efforts to colourise GHCi output.

Example

   Colour-ghci.png

Or a type error:

   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.

Implementation

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

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

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.