garabik / grc

generic colouriser
http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
Other
1.9k stars 162 forks source link

Support for pv? #12

Open Efreak opened 9 years ago

Efreak commented 9 years ago

Any chance of getting support for pv?

garabik commented 9 years ago

On Mon, Jul 27, 2015 at 09:33:42PM -0700, Efreak wrote:

Any chance of getting support for pv?

That's not a bad idea; unfortunately pv's stderr will be block buffered if redirected (and this is quite deep in glibc), so I'd have to look into using pseudoterminals (which is much more complicated). But it is something I have on my mind...

Efreak commented 9 years ago

I'm also uncertain how to buffer everything through a pty when the program detects output (ie a pipe). Is there a commandline argument for that?

It would also be useful to have a parameter that could swap the colors for some encoded version; this would allow colorizing the output of individual commands and piping them through other scripts that might remove the color (ie, grep)