Re: [libmnl PATCH] debug: don't colorize output on non tty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

On Wed, Oct 02, 2013 at 05:47:20PM +0200, Eric Leblond wrote:
> Hi Pablo,
> 
> Le mercredi 02 octobre 2013 à 17:25 +0200, Pablo Neira Ayuso a écrit :
> > Hi Eric,
> > 
> > On Mon, Sep 30, 2013 at 11:38:26PM +0200, Eric Leblond wrote:
> > > When output is not a tty (pipe or redirect to a file), the color
> > > display is causing the output to be unreadable:
> > >   02 00 00 00  |        |  extra header  |
> > >  |ESC[1;31m00008ESC[0m|ESC[1;32m--ESC[0m|ESC[1;34m00001ESC[0m|   |len |flags| type|
> > > This patch tests if the output is a terminal and only add color in
> > > this case. It also displays space instead of char 0 if a letter is
> > > not existing.
> > 
> > In both cases, you can use less -r to interpret the colors, is that
> > enough to address what you're noticing?
> 
> No, I don't think this is enough. First, you've got to know -r option of
> less ;) Second, this is really painful if you want to redirect the
> output to a file to edit it with a standard editor (that was my case).
> At last, git and a lot of software are doing that so some user are used
> to that behavior.

I can see that git allows you to enable/disable colors on demand. I
think we can have a new interface that includes a flags field for
this, so we can achieve the same way of working.

I'd like to keep some way to request colors, I usually redirect the
output to files and use less -r to watch them. Some days, when you
spent more than 8 hours in front of the computer, some colors help,
really :-).
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux