From owner-freebsd-arch@freebsd.org Sat Feb 17 02:03:49 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA8EF030E3 for ; Sat, 17 Feb 2018 02:03:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 646EF7F05D for ; Sat, 17 Feb 2018 02:03:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: by mailman.ysv.freebsd.org (Postfix) id 23B95F030E1; Sat, 17 Feb 2018 02:03:48 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8451F030E0 for ; Sat, 17 Feb 2018 02:03:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EEFA7F05C for ; Sat, 17 Feb 2018 02:03:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id mrqjeDPgXppe1mrqkeqMbl; Fri, 16 Feb 2018 19:03:39 -0700 X-Authority-Analysis: v=2.3 cv=Bo6zP7f5 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=Op4juWPpsa0A:10 a=1QTDH3R-AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=YSmn83ib1gz9zqs_wXUA:9 a=7M4Ih6oD_zTUWvVf:21 a=_pV0JO2eKVHIxZDZ:21 a=CjuIK1q_8ugA:10 a=A7PbjfUNzwAiWwc5k9lq:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E8DAB901; Fri, 16 Feb 2018 18:03:36 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w1H23aQ8023047; Fri, 16 Feb 2018 18:03:36 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w1H23ZTE023044; Fri, 16 Feb 2018 18:03:36 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201802170203.w1H23ZTE023044@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: mike@karels.net cc: arch@freebsd.org Subject: Re: ps output line length change In-Reply-To: Message from Mike Karels of "Fri, 16 Feb 2018 18:46:57 -0600." <201802170046.w1H0kvxN032252@mail.karels.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 16 Feb 2018 18:03:35 -0800 X-CMAE-Envelope: MS4wfGacMXlWmM5nxym9m90aZ6Laavg0BAz3xNBJvM1UCnjHlXoIsNYiLgkH7GOC4+PLO/ves2sswKphy+pgWDnsdpH+Wgj17dh8pUDVvDhTu2xTM++LZdFn u1Ug/49Vh/Sa3KRjIpeNV6HyZ7Th9XRjuMjt08Zhr8Hl6L0PhH/egiVzy0y9bbdm5+TU5/8o5PA5kBSoJzrT7jDbzeXT+6CNCDs= X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2018 02:03:49 -0000 In message <201802170046.w1H0kvxN032252@mail.karels.net>, Mike Karels writes: > A couple of weeks ago, I sent email on the committers list proposing > reversion of r314685 changing the output line length for ps. In > particular, it uses unlimited line length if stdout is not a tty. > The previous code used the tty width if any of stdout, stderr, or > stdin was a tty. The change in r314685 has not been shipped in > any release yet. > > The responses to that email all agreed with reversion. However, there > has been some additional discussion in private email. Therefore, I > am sending this to arch@. > > My reasoning is this; > > 1. The output line length for the following commands should reasonably > be the same in an interactive session: ps, ps | more, ps | grep. > > 2. The previous behavior is the way things have worked since 1990, > as Conrad pointed out. As others pointed out, it has long been known > that -ww was required to get unlimited lines, e.g. in a script. I > don't see any significant justification to change 28 years of precedent. > > 3. The rationale for the change included that it is easier for scripts > (which I maintain are broken if they assume this), and that it doesn't > matter if using less with left-right scrolling. We shouldn't make > assumptions about what the output is going through, let alone assume > left-right scrolling. The previous algorithm was described as magic, > but I think it is straightforward. Perhaps a comment is in order. > > I tried to think of a compromise solution, but the only thing that > comes to mind is messy: an environment variable that would enable > unlimited line length when the output was not a tty. That would not > be easier for scripts. And as Bruce noted, aliasing ps to "ps -ww" > does not work with old BSD-stype "ps axu". Agreed. I also agree scripts that expect wide output without ww are broken. However Linux ps, at least Red Hat, behaves the same. I believe the change was made to be more Linux compatible and allow greater portability. > > What do people think should be done? That's a tough one. Break Linux compatibility or break BSD compatibility? Generally Linux users use ps -ef which we don't support and columns are different so, Linux compatibility is... well just isn't. My vote is to revert and have an environment variable with defaults, e.g., PS=--linux or something similar. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.