Subject: bin/14956: top gratuitously cuts lines
To: None <gnats-bugs@gnats.netbsd.org>
From: seebs <seebs@ged.plethora.net>
List: netbsd-bugs
Date: 12/15/2001 03:04:27
>Number:         14956
>Category:       bin
>Synopsis:       top cuts some lines to 80 characters
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 15 01:05:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     seebs
>Release:        NetBSD 1.5Z
>Organization:
>Environment:
System: NetBSD ged.plethora.net 1.5Z NetBSD 1.5Z (GED) #0: Fri Nov 30 14:33:36 CST 2001 seebs@ged.plethora.net:/usr/src/sys/arch/i386/compile/GED i386
Architecture: i386
Machine: i386
>Description:
	On an 88-column screen, top is still trimming status lines at 80 chars.
	So, it confirms that screen_width is 87, and the clock in the upper right
	is in the right place, but the actual lines in the main display are all
	truncated early.

	This appears to be a result of a static format string.
>How-To-Repeat:
	Run top in an 88-column display.
>Fix:
	This is incorrect, but will work as long as no display has fewer than 67
	characters.  :)  It's at least a framework for a "real" solution.

*** m_netbsd15.c.orig	Sat Dec 15 03:01:31 2001
--- m_netbsd15.c	Sat Dec 15 03:02:19 2001
***************
*** 92,94 ****
  #define Proc_format \
! 	"%5d %-8.8s %3d %4d%7s %5s %-8.8s%7s %5.2f%% %5.2f%% %.12s"
  
--- 92,94 ----
  #define Proc_format \
! 	"%5d %-8.8s %3d %4d%7s %5s %-8.8s%7s %5.2f%% %5.2f%% %.*s"
  
***************
*** 188,189 ****
--- 188,190 ----
  #define pagetok(size) ((size) << pageshift)
+ extern int screen_width;
  
***************
*** 527,528 ****
--- 528,530 ----
  	    100.0 * pct,
+ 	    screen_width - 67,
  	    printable(pp->p_comm));
>Release-Note:
>Audit-Trail:
>Unformatted: