Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 May 1997 12:48:16 +0200 (CEST)
From:      Andreas Klemm <andreas@klemm.gtn.com>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/3477: top wastes 16 characters in USERNAME column
Message-ID:  <199705031048.MAA16098@klemm.gtn.com>
Resent-Message-ID: <199705031110.EAA24905@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3477
>Category:       bin
>Synopsis:       top wastes 16 characters in USERNAME column
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May  3 04:10:02 PDT 1997
>Last-Modified:
>Originator:     Andreas Klemm
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>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.
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705031048.MAA16098>