netfilter-devel.vger.kernel.org archive mirror
 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: Wed, 2 Oct 2013 17:25:12 +0200	[thread overview]
Message-ID: <20131002152512.GA22293@localhost> (raw)
In-Reply-To: <1380577106-13006-1-git-send-email-eric@regit.org>

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?

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

Let me know.

  reply	other threads:[~2013-10-02 15:25 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 [this message]
2013-10-02 15:47   ` Eric Leblond
2013-10-11  8:53     ` Pablo Neira Ayuso

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=20131002152512.GA22293@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).