Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Aug 2009 12:28:30 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Brian Somers <brian@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org, Ivan Radovanovic <rivanr@gmail.com>
Subject:   Re: Deprecating ps(1)s -w switch
Message-ID:  <86fxbd1rg1.fsf@ds4.des.no>
In-Reply-To: <20090826234009.13b90734@dev.lan.Awfulhak.org> (Brian Somers's message of "Wed, 26 Aug 2009 23:40:09 -0700")
References:  <20090825034054.2d57e733@dev.lan.Awfulhak.org> <20090826234009.13b90734@dev.lan.Awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Brian Somers <brian@FreeBSD.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86fxbd1rg1.fsf>