All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Eric Leblond <eric@regit.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [libmnl PATCH] debug: don't colorize output on non tty
Date: Fri, 11 Oct 2013 10:53:38 +0200	[thread overview]
Message-ID: <20131011085338.GA4103@localhost> (raw)
In-Reply-To: <1380728840.24406.29.camel@ice-age.regit.org>

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2013-10-11  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 21:38 [libmnl PATCH] debug: don't colorize output on non tty Eric Leblond
2013-10-02 15:25 ` Pablo Neira Ayuso
2013-10-02 15:47   ` Eric Leblond
2013-10-11  8:53     ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131011085338.GA4103@localhost \
    --to=pablo@netfilter.org \
    --cc=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.