From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 27 10:28:32 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C379D106564A; Thu, 27 Aug 2009 10:28:32 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 86C1A8FC41; Thu, 27 Aug 2009 10:28:32 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 42AD56D418; Thu, 27 Aug 2009 10:28:31 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1C309844C4; Thu, 27 Aug 2009 12:28:31 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Brian Somers References: <20090825034054.2d57e733@dev.lan.Awfulhak.org> <20090826234009.13b90734@dev.lan.Awfulhak.org> Date: Thu, 27 Aug 2009 12:28:30 +0200 In-Reply-To: <20090826234009.13b90734@dev.lan.Awfulhak.org> (Brian Somers's message of "Wed, 26 Aug 2009 23:40:09 -0700") Message-ID: <86fxbd1rg1.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@FreeBSD.org, Ivan Radovanovic Subject: Re: Deprecating ps(1)s -w switch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2009 10:28:32 -0000 Brian Somers writes: > To clarify, my proposal is to silently ignore the -w switch (any/all of t= hem) > and to remove the code that reads the terminal width and truncates some > columns based on the result (or based on "132"). > > The pros: > > - ps's code becomes simpler. It was mentioned that the ps code is > a minefield. This would remove a few mines. Frankly, the width limiting code is the least of ps's problems. > - ps IMHO has no business knowing about terminal widths (and where > did the 132 column -w idea come from again?). Some programs such > as iostat have similar (but way more broken) behaviour however whilst > others such as ls do not. Actually, ls does pretty much the same thing (use a different layout when run on a tty), and it's far from the only Unix utility to do so. Usually, the tty layout is "pretty" while the non-tty layout is easier to work with in scripts. > The cons: > [...] > - Scripts may exist that depend on the behaviour without -w. Furthermore > having to handle ps from both before and after such a change in one > script can be painful. Breaking existing scripts would be an *extremely* unwise and unpopular move. The only part of your proposal I support is removing the 132-column limit on 'ps -w' (which I believe would make the output from 'ps -w' identical to that from 'ps -ww') DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no