Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progressively coloring character instead of line output #37

Open
1-61803 opened this issue Jul 11, 2016 · 4 comments
Open

progressively coloring character instead of line output #37

1-61803 opened this issue Jul 11, 2016 · 4 comments

Comments

@1-61803
Copy link

1-61803 commented Jul 11, 2016

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.

2-1
2-2

I would expect it to colourise each timeout char as soon as it happens, instead of buffering the whole line.

1-1
1-2
1-3

@derimagia
Copy link
Contributor

derimagia commented Oct 30, 2016

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 #25 (comment)

@1-61803
Copy link
Author

1-61803 commented Oct 30, 2016

@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).

@derimagia
Copy link
Contributor

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

@1-61803
Copy link
Author

1-61803 commented Oct 31, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants