From owner-svn-src-all@freebsd.org Sat Mar 10 06:35:59 2018 Return-Path: Delivered-To: svn-src-all@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 1B5E8F292F0; Sat, 10 Mar 2018 06:35:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 77E478605B; Sat, 10 Mar 2018 06:35:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 2872B1049F85; Sat, 10 Mar 2018 17:35:56 +1100 (AEDT) Date: Sat, 10 Mar 2018 17:35:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mike Karels cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330712 - head/bin/ps In-Reply-To: <201803100010.w2A0AlkF008785@repo.freebsd.org> Message-ID: <20180310171525.R971@besplex.bde.org> References: <201803100010.w2A0AlkF008785@repo.freebsd.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=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=eLFt2R2capelzvn5pO4A:9 a=J6VmII6G4GYPtRYm:21 a=EOEuclWW4B7WC7QA:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Sat, 10 Mar 2018 06:35:59 -0000 On Sat, 10 Mar 2018, Mike Karels wrote: > ... > Log: > Change ps(1) output width to unlimited if not interactive > ... > Modified: head/bin/ps/ps.1 > ============================================================================== > --- head/bin/ps/ps.1 Fri Mar 9 23:37:19 2018 (r330711) > +++ head/bin/ps/ps.1 Sat Mar 10 00:10:47 2018 (r330712) > @@ -101,6 +101,14 @@ The default output format includes, for each process, > controlling terminal, state, CPU time (including both user and system time) > and associated command. > .Pp > +If the > +.Nm > +process is associated with a terminal, the default output width is that of the > +terminal; otherwise the output width is unlimited. It is unclear how a process is assocated with a terminal and thus what this width is. For ps, unlike for most programs, a process is associated with a terminal iff any of the 3 standard file descriptors is a terminal that supports the TIOCGWINSZ ioctl, and the width of the preferred one is not 0. The preferred one is the first of STDOUT_FILENO, STDERR_FILENO and STDIN_FILENO that supports the ioctl. BUGS: if the first one somehow has width 0, then the process is considered as not being associated with a terminal even of a later one has a nonzero width. > ... > Modified: head/bin/ps/ps.c > ============================================================================== > --- head/bin/ps/ps.c Fri Mar 9 23:37:19 2018 (r330711) > +++ head/bin/ps/ps.c Sat Mar 10 00:10:47 2018 (r330712) > @@ -202,6 +202,11 @@ main(int argc, char *argv[]) > * any of stdout, stderr, or stdin is a terminal. The intent > * is that "ps", "ps | more", and "ps | grep" all use the same > * default line length unless -w is specified. > + * > + * If not interactive, the default length was traditionally 79. > + * It has been changed to unlimited. This is mostly for the > + * benefit of non-interactive scripts, which arguably should > + * use -ww, but is compatible with Linux. > */ This belongs in the HOSTORY section of the man page, with version info for the change. Bruce