grc
grc copied to clipboard
progressively coloring character instead of line output
When a command progressively sends characters to stdout
on the same line, grc
waits for the whole line, applies color and eventually returns the output.
Here's an example with traceroute
on OS X.
I would expect it to colourise each timeout char as soon as it happens, instead of buffering the whole line.
My fix for this in the meantime is to prefix my aliases with stdbuf -oL
https://www.gnu.org/software/coreutils/manual/html_node/stdbuf-invocation.html
See https://github.com/garabik/grc/issues/25#issuecomment-251001275
@derimagia, that also does line buffering. So in case of traceroute
, I have to wait for a node not responding the default 15" timeout interval for 3 probes, before the 3 asterisks are colourized red (see my first example above).
Sorry misunderstood since for me the traceroute didn't even buff per line before I changed it. Buffing per character would be really difficult to do since it relies on regex. Work may be easier but even then it's difficult
grc
1.9 buffers lines in my system (10.8.5) by default. I don't know if character buffering would be possible — anyway, gstdbuf
doesn't accept less than 1 K/KB, in case that'd be an option.