rainbowstream icon indicating copy to clipboard operation
rainbowstream copied to clipboard

How to disable color output

Open CuriousMarc opened this issue 5 years ago • 2 comments

I need to disable color output so I can pipe it to another process, or to a Teletype (!). How can I do that? Marc

CuriousMarc avatar Apr 17 '20 20:04 CuriousMarc

Answering my own question, invoking rainbowstream like this is a workaround, stripping color codes with a pipe to sed:

rainbowstream | sed 's/\x1b[[0-9;]*m//g'

Marc

CuriousMarc avatar Apr 17 '20 23:04 CuriousMarc

Well, that worked with Ubuntu, but somehow not on Debian. To make the same thing kind of work on Debian, I had to do:

stdbuf -oL rainbowstream | sed 's/\x1b[[0-9;]*m//g'

or the output of rainbowstream would be caught in the stdout buffer. The only issue with this one is that it does not print the prompts. Otherwise it works fine on keyboard input.

CuriousMarc avatar Apr 22 '20 06:04 CuriousMarc