From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 14 19:57:26 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 4D0731065670; Sun, 14 Aug 2011 19:57:26 +0000 (UTC) Date: Sun, 14 Aug 2011 19:57:26 +0000 From: Alexander Best To: Edward Tomasz Napiera?a Message-ID: <20110814195726.GA25655@freebsd.org> References: <0CEA161B-6767-4379-B923-585B3D4EA74E@freebsd.org> <86hb6e1bau.fsf@gmail.com> <589EB85A-1902-4643-A1FD-3C98445127DB@freebsd.org> <20110724222224.GA64487@freebsd.org> <20110724230617.GA69612@freebsd.org> <8D7CEA8F-AF55-4509-9C90-74FC42A9A020@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8D7CEA8F-AF55-4509-9C90-74FC42A9A020@freebsd.org> Cc: Test Rat , freebsd-hackers@freebsd.org Subject: Re: Autosizing column widths in ps(1). X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2011 19:57:26 -0000 On Tue Jul 26 11, Edward Tomasz Napiera?a wrote: > Wiadomo?? napisana przez Alexander Best w dniu 25 lip 2011, o godz. 01:06: > > On Sun Jul 24 11, Alexander Best wrote: > >> On Sun Jul 24 11, Edward Tomasz Napiera?a wrote: > >>> Wiadomo?? napisana przez Test Rat w dniu 22 lip 2011, o godz. 19:21: > >>>> Edward Tomasz Napiera?a writes: > >>>> > >>>>> Patch below changes ps(1) to automatically size column widths according to their > >>>>> contents. From the user point of view, it prevents breaking layout with too wide values > >>>>> and in most cases makes output narrower. From the developer point of view, it removes > >>>>> the need to specify widths. Testing is welcome - the patch shouldn't change ps(1) > >>>>> behaviour except slightly changing the widths, but the code changes are pretty large > >>>>> and it's quite possible I've missed something. > >>>> > >>>> STAT column seems to be right-aligned when it was previously left-aligned. > >>>> This makes sorting it harder, e.g. > >>>> > >>>> $ ps ax | (IFS=; read h; echo $h; sort -k3) | less > >>> > >>> Good catch, thanks! Updated patch, which also fixes two issues affecting TTY column, > >>> is at http://people.freebsd.org/~trasz/ps-9.diff. > > > > any reason there are always a minimum of 2 spaces between the "TT" and the > > "TIME" column and not a single space? > > The 'TT' column ends with either a space, or a '-'. As you've noticed, in the common > case there will be no hyphens there; I'll see if I can remove the extra spacing. hmmm...i've never seen a "-" in the TT column to be honest. any chance your patch will get committed before 9.0? i really like it. :) > > -- > If you cut off my head, what would I say? Me and my head, or me and my body?