From owner-freebsd-arch@freebsd.org Sat Feb 17 00:46:59 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 698CAF22593 for ; Sat, 17 Feb 2018 00:46:59 +0000 (UTC) (envelope-from mike@karels.net) 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 0959F7BC3B for ; Sat, 17 Feb 2018 00:46:59 +0000 (UTC) (envelope-from mike@karels.net) Received: by mailman.ysv.freebsd.org (Postfix) id B934CF22592; Sat, 17 Feb 2018 00:46:58 +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 A7A80F22591 for ; Sat, 17 Feb 2018 00:46:58 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id 40A187BC3A for ; Sat, 17 Feb 2018 00:46:57 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.15.2/8.15.2) with ESMTP id w1H0kvxN032252 for ; Fri, 16 Feb 2018 18:46:57 -0600 (CST) (envelope-from mike@karels.net) Message-Id: <201802170046.w1H0kvxN032252@mail.karels.net> To: arch@freebsd.org From: Mike Karels Reply-to: mike@karels.net Subject: ps output line length change MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32250.1518828417.1@mail.karels.net> Date: Fri, 16 Feb 2018 18:46:57 -0600 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 00:46:59 -0000 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". What do people think should be done? Thanks, Mike ------- End of Forwarded Message