[Haskell-cafe] Re: Interpreter output in color

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Thu Dec 14 12:07:02 EST 2006

dons at cse.unsw.edu.au (Donald Bruce Stewart) wrote:

> Currently, there is an existing tool, HsColour:
>     http://www.cs.york.ac.uk/fp/darcs/hscolour/
> Here's a mockup (the result of dumping ghci's output through HsColour):

Have you tried just piping ghci through HsColour interactively?
    ghci 2>&1 | HsColour -tty
It works surprisingly well.  I just pushed a patch that ensures stdout
is unbuffered in interactive mode, so you can see the prompt before you
type something, rather than after completing a line.  Colouring is still
a little bit jumpy, because HsColour has to consume one whole lexeme
before colouring it, but the result is not bad.  It does tend to mess
with readline a bit though...


More information about the Haskell-Cafe mailing list