[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1443101279.29850.162.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 24 Sep 2015 06:27:59 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Phil Sutter <phil@....cc>
Cc: Stephen Hemminger <stephen@...workplumber.org>,
netdev@...r.kernel.org
Subject: Re: RFC: ss: improve horizontal output scaling
On Thu, 2015-09-24 at 14:36 +0200, Phil Sutter wrote:
> This is because TIOCGWINSZ returns 80 if the output is a pipe.
Not exactly.
ss doesn't even call TIOCGWINSZ if output is a pipe.
Exact code is :
screen_width = 80;
if (isatty(STDOUT_FILENO)) {
struct winsize w;
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1) {
if (w.ws_col > 0)
screen_width = w.ws_col;
}
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists