From owner-svn-src-all@freebsd.org Tue Mar 7 04:11:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC3A5D0150A; Tue, 7 Mar 2017 04:11:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 971C91F6E; Tue, 7 Mar 2017 04:11:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id B4E3016D; Tue, 7 Mar 2017 04:11:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 0DC9A35446; Tue, 7 Mar 2017 04:11:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 6QoruNJisccL; Tue, 7 Mar 2017 04:11:33 +0000 (UTC) Subject: Re: svn commit: r314685 - head/bin/ps DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com D45E43543F To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703042238.v24McAD8008837@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <01dddec8-89c0-e18a-a481-e802643f9e0e@FreeBSD.org> Date: Mon, 6 Mar 2017 20:11:31 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201703042238.v24McAD8008837@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="up7CmC8UErl3C1ts7tV7q9B45s4Ejl54E" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 04:11:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --up7CmC8UErl3C1ts7tV7q9B45s4Ejl54E Content-Type: multipart/mixed; boundary="CuUcadL6ajKhjO0sj0Hxtk5uDKlRqp8fC"; protected-headers="v1" From: Bryan Drewery To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <01dddec8-89c0-e18a-a481-e802643f9e0e@FreeBSD.org> Subject: Re: svn commit: r314685 - head/bin/ps References: <201703042238.v24McAD8008837@repo.freebsd.org> In-Reply-To: <201703042238.v24McAD8008837@repo.freebsd.org> --CuUcadL6ajKhjO0sj0Hxtk5uDKlRqp8fC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/4/17 2:38 PM, Conrad Meyer wrote: > Author: cem > Date: Sat Mar 4 22:38:10 2017 > New Revision: 314685 > URL: https://svnweb.freebsd.org/changeset/base/314685 >=20 > Log: > ps(1): Only detect terminal width if stdout is a tty > =20 > If stdout isn't a tty, use unlimited width output rather than truncat= ing to > 79 characters. This is helpful for shell scripts or e.g., 'ps | grep= foo'. This change actually makes things worse for me for 'ps uaxwd|less' Before: > nobody 83979 0.0 0.0 9016 1364 3 I+J 20:03 0:00.= 06 | | `-- /usr/bin/make -C /usr/ports/lang/perl5.24 build After: > nobody 89743 0.0 0.0 9016 1368 3 S+J 20:07 0:00.= 05 | | `-- /usr/bin/make -C /usr/ports/lang/perl5.24 I now have to specify -ww to not cut things off, but that's far more than I want to see. > =20 > This hardcoded width has some history: In The Beginning of History[0]= , the > width of ps was hardcoded as 80 bytes. In 1985, Bloom@ added detecti= on > using TIOCGWINSZ on stdin.[1] In 1986, Kirk merged a change to check= > stdout's window size instead. In 1990, the fallback checks to stderr= and > stdin's TIOCGWINSZ were added by Marc@, with the commit message "new > version."[2] > =20 > OS X Darwin has a very similar modification to ps(1), which simply se= ts > UNLIMITED for all non-tty outputs.[3] I've chosen to respect COLUMNS= > instead of behaving identically to Darwin here, but I don't feel stro= ngly > about that. We could match OS X for parity if that is desired. > =20 > [0]: https://svnweb.freebsd.org/csrg/bin/ps/ps.c?annotate=3D1065 > [1]: https://svnweb.freebsd.org/csrg/bin/ps/ps.c?r1=3D18105&r2=3D1810= 6 > [2]: > https://svnweb.freebsd.org/csrg/bin/ps/ps.c?r1=3D40675&r2=3D40674&pat= hrev=3D40675 > [3]: > https://opensource.apple.com/source/adv_cmds/adv_cmds-168/ps/ps.c.aut= o.html > =20 > PR: 217159 > Reported by: Deepak Nagaraj >=20 > Modified: > head/bin/ps/ps.c >=20 > Modified: head/bin/ps/ps.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/bin/ps/ps.c Sat Mar 4 22:23:59 2017 (r314684) > +++ head/bin/ps/ps.c Sat Mar 4 22:38:10 2017 (r314685) > @@ -194,6 +194,8 @@ main(int argc, char *argv[]) > =20 > if ((cols =3D getenv("COLUMNS")) !=3D NULL && *cols !=3D '\0') > termwidth =3D atoi(cols); > + else if (!isatty(STDOUT_FILENO)) > + termwidth =3D UNLIMITED; > else if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) =3D=3D -1 && > ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) =3D=3D -1 && > ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) =3D=3D -1) || >=20 --=20 Regards, Bryan Drewery --CuUcadL6ajKhjO0sj0Hxtk5uDKlRqp8fC-- --up7CmC8UErl3C1ts7tV7q9B45s4Ejl54E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJYvjL0AAoJEDXXcbtuRpfP+5IH/0QCsQX4BtJgdFD2h5oV8nml bFRxd+O0koTdSlj8RO7M6oQ5oeKb6P8KK+s8iDwJNeF8KGAL3jPc/vgJKO4Ev+ND L5p3pj3Fk2wCNpwlgKyH1gOlHd0nzbw3T7+TyskCYXMhAPw0GTA/ucdNNpdErjWp 7CCRwgkj93l8i4ccq0pJELHO5xBIR+DxDiBwHYLzvRZ8hu74tFzmFdrbkmXW3EQY u/vbhfTOvPweuSxH4hqBxiui5sUZDKb7kA8se6PjRoxnBxDVu5eMKk0f6lr40hp0 2XsXsoUEhplS/+81KNtCzaQRsXWMtqEnyZBI+PI0Ep7cgTp5lrds/HDI93e2mo0= =zKeo -----END PGP SIGNATURE----- --up7CmC8UErl3C1ts7tV7q9B45s4Ejl54E--