Deprecated in favor of ansifilter.
--
term-to-pango is a tool to convert ANSI escape-coded text to Pango Markup.
It's particularly useful if you want to display the output of a terminal tool inside a GUI program that renders text with Pango (and supports markup).
Screenshot: The output of Taskwarrior and grep rendered with term-to-tango and displayed in nwg-wrapper. It demonstrates underlined, bold and colored text |
https://docs.haskellstack.org/en/stable/
stack build
stack install
To use term-to-pango
, simply pipe the ANSI-colored text through it, like so:
grep --color=always some-pattern file.txt | term-to-pango
Currently, we support only the simplest “named” colors like “red”, “green” and so on. In principle, nothing prevents us from supporting the whole RGB range. The support should be easy to add, so feel free to drop me a patch.
We also don't support some text attdibutes like reverseVideo
, dim
and
blink
. I wasn't sure what to map them to.