From owner-svn-src-all@freebsd.org Sun Mar 5 04:57:32 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 2A76ACFA105; Sun, 5 Mar 2017 04:57:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id CF1D8160C; Sun, 5 Mar 2017 04:57:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 36493427A46; Sun, 5 Mar 2017 15:57:29 +1100 (AEDT) Date: Sun, 5 Mar 2017 15:57:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314685 - head/bin/ps In-Reply-To: Message-ID: <20170305150734.K2493@besplex.bde.org> References: <201703042238.v24McAD8008837@repo.freebsd.org> <20170305115437.R1556@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=D_tafSauxoz0-rkh7v0A:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 a=IjZwj45LgO3ly-622nXo:22 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: Sun, 05 Mar 2017 04:57:32 -0000 On Sat, 4 Mar 2017, Conrad Meyer wrote: > On Sat, Mar 4, 2017 at 6:50 PM, Bruce Evans wrote: >>> Author: cem >>> Date: Sat Mar 4 22:38:10 2017 >>> New Revision: 314685 >>> URL: https://svnweb.freebsd.org/changeset/base/314685 >>> >>> Log: >>> ps(1): Only detect terminal width if stdout is a tty >>> >>> If stdout isn't a tty, use unlimited width output rather than truncating >>> to >>> 79 characters. This is helpful for shell scripts or e.g., 'ps | grep >>> foo'. >> >> This breaks many interactive uses, e.g., 'ps l | less', to work around a >> user error. > > Can you illustrate what breaks here? less(1) doesn't wrap lines and > instead supports side-to-side scrolling with left/right arrow keys. less does wrap long lines. However, it has an option -S to cause long lines to be chopped. Also, if you use side-to-side scrolling then it switches to -S mode except at the leftmost column. Thus, less acts like you say if started with -S. If not started with -S, it makes a mess of the leftmost screen. Other display utilities might not have the sideways scrolling. I normally use an old version of less that doesn't have it, and sometimes vi to just read things. It does have -S. vi doesn't have it or even truncation AFAIK. I often use the display method of dropping large output into the terminal's history buffer and scrolling back using the terminal's scroll keys. This works better than less for many purposes. It doesn't do sideways scrolling. With syscons, some of the history survives a frame buffer geometry change but the history is raw so line breaks cannot be recovered, and the current screen is cleared together with its history instead of redrawn. With xterm, there is no bogus clearing but the line breaks are not recovered. Another broken use is ps l | grep where the output is sent to the screen. It is now wide, so hard to read without piping it further through a viewer with sideways scrolling. Sideways scrolling is not too bad for tabular formats like ps's where you often want to look at 1 column at a time, but I don't like it for general use and prefer truncation. less in an xterm can be resized with recoverable line breaks but I rarely use X. Truncation by the viewer is not as good as truncation by the producer. ps should expand leading field widths so as to truncates leading fields less if the output is wide. This would move important later fields into the truncated region if the viewer truncates. > The user should get basically the same output with 'ps l | less' as > with 'ps l', aside from ability to scroll up/down and left/right. This takes a nonstandard version of less (perhaps an alias). So some users would notice this change more than others. It is interesting that ps -ww doesn't work as an alias for ps for users who are used to typing ps args without a '-'. ps -ww -l works, but ps -ww l is a syntax error. Bruce