top(1) annoyances
Samuel J. Greear
sjg at evilcode.net
Fri Feb 4 11:04:59 PST 2011
On Fri, Feb 4, 2011 at 11:42 AM, Matthew Dillon
<dillon at apollo.backplane.com> wrote:
> :in conclusion, I suggest:
> :
> :1) re-enabling the annoying top warning message, and perhaps choosing
> : a sensible default to prevent the annoying warning on a handy-dandy
> : default punched-card sized 80x24 display
> :
> :this would mean changing DEFAULT_TOPN in /usr/src/usr.bin/top/config.h
> :to 17. (24 - 7 for the 'header' stuff)
> :
> :fun.
> :
> :comments?
> :
> :- Chris
>
> I don't see any reason to re-enable the annoying top warning message.
>
> We could just set DEFAULT_TOPN to something big, too, like 100, but
> it might make more sense to simply size it to the number of rows on
> the terminal. I dunno.
>
> -Matt
> Matthew Dillon
> <dillon at backplane.com>
>
I don't see any reason not to re-enable the warning if we make row
detection programmatic, it would only appear then if something wonky
is going on (and if something wonky / out of the norm. is going on
with my terminal, I -would- want to see the warning).
In my opinion the best thing to do would be to firstly check the
environment for ROWS (I think?) and if those are not present,
determine rows in the same fashion as `stty size`, and if that fails,
fall back to using DEFAULT_TOPN.
I have no opinion on the default value of DEFAULT_TOPN if the above is
done, but 17 is probably quite reasonable, as most terminals default
to 24 rows.
Sam
More information about the Kernel
mailing list