From andreas@klemm.gtn.com  Sat May  3 04:06:37 1997
Received: from news1.gtn.com (news1.gtn.com [192.109.159.3])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA24789
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 3 May 1997 04:06:24 -0700 (PDT)
Received: (from uucp@localhost) by news1.gtn.com (8.7.2/8.7.2) with UUCP id NAA26627 for FreeBSD-gnats-submit@freebsd.org; Sat, 3 May 1997 13:00:23 +0200 (MET DST)
Received: (from andreas@localhost) by klemm.gtn.com (8.8.5/8.8.2) id MAA16098; Sat, 3 May 1997 12:48:16 +0200 (CEST)
Message-Id: <199705031048.MAA16098@klemm.gtn.com>
Date: Sat, 3 May 1997 12:48:16 +0200 (CEST)
From: Andreas Klemm <andreas@klemm.gtn.com>
Reply-To: andreas@klemm.gtn.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: top wastes 16 characters in USERNAME column
X-Send-Pr-Version: 3.2

>Number:         3477
>Category:       bin
>Synopsis:       top wastes 16 characters in USERNAME column
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    peter
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May  3 04:10:02 PDT 1997
>Closed-Date:    Thu Aug 28 04:00:35 PDT 1997
>Last-Modified:  Thu Aug 28 04:03:27 PDT 1997
>Originator:     Andreas Klemm
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

top was added to the OS in FreeBSD-current 3.0

>Description:

Size of loginname was increased to 16 characters in FreeBSD-current.
Top' display of the USERNAME field was statically increased to 16
columns wide output as well. Look here:

  PID USERNAME         PRI NICE SIZE   RES STATE C   TIME   WCPU    CPU COMMAND
  241 andreas           2  0  6396K 10264K select1   2:26  0.34%  0.34% XF86_S
15462 andreas           2  0   372K  1212K select0   0:00  0.04%  0.04% rxvt
15380 andreas          18  0   748K   948K pause 0   0:00  0.00%  0.00% tcsh
 5766 andreas          18  0   204K   848K pause 1   0:22  0.00%  0.00% ascloc 
   20 root             10  0 16488K  3308K mfsidl0   0:00  0.00%  0.00% mount_

In most cases you only watch USERNAMES with less characters. So top
wastes much space that would badly be needed for the last COMMAND colunm,
which now has only a size of 6. This causes, that even names of system 
binaries as mount_mfs are badly truncated. So you can't differentiate
between mount_mfs and mount_nfs  for example.

>How-To-Repeat:

	

>Fix:
	
Some proposals to enhance the readability of tops output:

1) top should be made aware of display sizes > 80 columns and use the
   rest of space for the COMMAND output.

   When running under X11 in a xterm session it should recalculate the
   display size, when the xterm window has been resized.

2) Very nifty would be an additional command, that allows to toggle
   between two modes

	a) show as much from a COMMANDS commandline as possible
	b) show only as much from the command name (only the name)
	   as possible.

	I'd suggest 'w' for "wide command display" like the w
	option in ps.

3) top should only use as much space for the USERNAME column as actually
   needed. I think it wouldn'd make sense, to bring too much dynamic in here.
   It should be sufficiant, to check the size for the USERNAME column
   at startup. 

4) an additionally top command, to change the size during runtime.

   'c' as "column size" of the USERNAME field.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wosch 
State-Changed-When: Thu Aug 28 04:00:35 PDT 1997 
State-Changed-Why:  

RCS file: /usr/cvs/src/usr.bin/top/machine.c,v 
---------------------------- 
revision 1.5 
date: 1997/07/14 09:06:46;  author: peter;  state: Exp;  lines: +25 -19 
Hack to work around the large username field...  scan for the largest 
username present on the system at startup and use that for the field width. 
It's not ideal but (I think) better than it was before.  The width is 
limited to within 8..16. 



Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Thu Aug 28 04:00:35 PDT 1997 
Responsible-Changed-Why:  
>Unformatted:
