Re: [PATCH] top(1) inverse display of table header

From: Anonymous <swell.k_at_gmail.com>
Date: Wed, 17 Nov 2010 10:26:38 +0300
Xin LI <delphij_at_delphij.net> writes:

> Hi,
>
> Here is a patch that makes top(1) to inverse its table header (PID
> USERNAME THR, etc).
>

That MAX_COLS change in it makes `top -b' produce too much extra
whitespace that's not trimmed and spans several lines, e.g.

  $ stty -a | sed 1q
  speed 38400 baud; 57 rows; 79 columns;
  $ top -b
  last pid: 54799;  load averages:  1.90,  2.16,  2.16  up 0+04:28:34    10:18:15
  91 processes:  4 running, 85 sleeping, 2 stopped

  Mem: 540M Active, 243M Inact, 2934M Wired, 79M Cache, 417M Buf, 136M Free
  Swap: 4097M Total, 8856K Used, 4088M Free


    PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND                                                                                                                                                                                                                                                                                                                                                                                                            
   1730 holo           14  46    0   358M   197M ucond   1   1:24  0.00% firefox-bin

FYI, using inverse color for header line can also be achieved on
top-3.8b1 without touching source at all

  $ export TOPCOLORS='header=,#7'

edwin_at_ planned to update top(1) but stalled, not sure why.

  http://docs.freebsd.org/cgi/mid.cgi?20080928054620.GA80250

And I for one still use his branch with below diff.


Received on Wed Nov 17 2010 - 06:27:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:09 UTC