Now I use most as my pager. Although it does have useful syntax highlighting for man pages, it lacks the color syntax highlighting for anything else (I'm specifically looking for diff / C ++).
Meanwhile, pygments is a great program. I can easily draw colored output with it:
# ./pygmentize -f console256 ${file} hg diff | ./pygmentize -f console256 -l diff
Now I would like to be able to display output, so I just use:
# ./pygmentize -f console256 ${file} | most hg diff | ./pygmentize -f console256 -l diff | most
At this point, most uploads all the color management symbols to my screen as follows:
^[[38;5;28;01mclass^[[39;00m ^[[38;5;21;01mheap_allocator^[[39;00m { ^[[38;5;28;01mpublic^[[39;00m^[[38;5;241m:^[[39m
This, of course, is unreadable. I looked at the man page for most , but I could not find any options "Hey, show these control characters as colors instead of printing them." less has the same garbage behavior as most , but more shows colors perfectly, with obvious limitations on more .
Is there a pager that supports syntax highlighting or some crazy combination of parameters and programs that I can combine to make this work? Ultimately, I would like to get the difference and the logs from Mercurial to be highlighted, so maybe there is a shortcut ...
Travis gockel
source share