Skip to contentSkip to conversation

Adding --color option to script?

DISCUSSION Philip Prindeville 1 participant 1 message Mar 10, 2011 2 messages not in the archive Util-Linux package

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Karel Zak
Quoted 3 lines · Philip Prindeville

I would love to see an option like --color which used terminal colors to highlight STDERR output (or, in a pinch, maybe bold it on terminals that don't support color... if they still exist).

Quoted 9 lines

The script(1) command does not work on this level. It reads data directly from master side of the terminal. It means that we are not able to distinguish between stdout and stderr.

Quoted 1 line

Sound reasonable?

Yes, but I don't see a way how to implement it.

Karel

I just realized... it can be done by having two ptys, one for stdin/stdout, and another just for stderr.

-Philip