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

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

 



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.

> The chunk to replace char 0 by 32 looks fine to me.

OK.

BR,
-- 
Eric Leblond <eric@xxxxxxxxx>

--
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