Hacker News new | ask | show | jobs
by ajanuary 4761 days ago
Is it just me or is there a bug shown in their second example? The closing square bracket isn't coloured.
1 comments

That's because the log was already colored (the word "fail" in red). As colout tries to color the whole line, the previous end escape character is interpreted by the terminal before the last one :

    <red>* This is a colored line [<red>fail<end>]</end>
(You can use the `--debug` switch of colout to get hints about such problems).