From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 22 17:49:32 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7862F1065672 for ; Fri, 22 Jul 2011 17:49:32 +0000 (UTC) (envelope-from ttsestt@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 02BC38FC17 for ; Fri, 22 Jul 2011 17:49:31 +0000 (UTC) Received: by wyg24 with SMTP id 24so2191994wyg.13 for ; Fri, 22 Jul 2011 10:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=G4E+EfJRXbOJcF6qtJetpyBCaLkIe1NtYZHVlg8LTkE=; b=b3ddvDX7z5khABzVhGRhXR/QFOmQXHqdpiED03IJqcn3wig+TJHYfQGEKlBm4jVr0D 9FsXZbu6f4UTSKBjM1YgiTEYkUGLw1L17+eWyvLSMl7RSUtlkIlPJAQoL5OenHoL2Y4T A/65z7q83MYQL7p5vGsbQE+rIWwreMgD95wK0= Received: by 10.227.197.194 with SMTP id el2mr1492085wbb.55.1311355281836; Fri, 22 Jul 2011 10:21:21 -0700 (PDT) Received: from localhost ([72.46.129.46]) by mx.google.com with ESMTPS id b13sm2071095wbh.41.2011.07.22.10.21.20 (version=SSLv3 cipher=OTHER); Fri, 22 Jul 2011 10:21:21 -0700 (PDT) From: Test Rat To: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= References: <0CEA161B-6767-4379-B923-585B3D4EA74E@freebsd.org> Date: Fri, 22 Jul 2011 21:21:13 +0400 In-Reply-To: <0CEA161B-6767-4379-B923-585B3D4EA74E@freebsd.org> ("Edward Tomasz =?utf-8?Q?Napiera=C5=82a=22's?= message of "Fri, 22 Jul 2011 17:51:28 +0200") Message-ID: <86hb6e1bau.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 22 Jul 2011 18:02:09 +0000 Cc: 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: Fri, 22 Jul 2011 17:49:32 -0000 Edward Tomasz Napiera=C5=82a writes: > Patch below changes ps(1) to automatically size column widths according t= o 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 vie= w, it removes > the need to specify widths. Testing is welcome - the patch shouldn't cha= nge ps(1) > behaviour except slightly changing the widths, but the code changes are p= retty 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=3D; read h; echo $h; sort -k3) | less