[Toybox] top UI question.
Rob Landley
rob at landley.net
Wed Jan 20 15:48:57 PST 2016
I got top checked in, and there are still some glitches (the initial
CPU usage display is 100% times however many cpu ticks the process
managed to get in a quarter second, the TIME+ display is showing
amount used since LAST display, not cumulative... There's internal
plumbing issues for these), but it's basically working. I still need
to make the up/down keys switch the sort order, but left and right
change the sort fields.
Controlling WHICH fields to display is next up. The way ubuntu's top
does it is the f and o keys pull up modal dialogs with each field
assigned a letter. Except I'm still adding fields so letters would
move around (unless I put them in the array, and I don't want to go
there).
What I'd really RATHER do is just hook up the -o and -k options that
ps is already using. Why do it _differently_? This is a "historical
usage" vs "consistent usage" thing. (I'm unaware of busybox
implementing this at all, so...)
The downside is you'd have to exit top and restart it to change the
fields displayed or the sort order, but command line history makes
that relatively easy. (q cursor up, edit, enter) if you know what
fields you want. (The menu does show you the available fields, but so
does ./ps --help and unlike ubuntu's top, mine are the same ones. In
fact top and iotop are the same plumbing with different main()
functions, if hook up -o and -k they more or less collapse together
and become different default values.)
Other downside: iotop already assigned -k and -o (kilobytes and only
active) so I'd need something like -K and -O. I'd probably bump
iotop's to -K kilobytes and -O only active, and have -k -o match ps...
Anyway, anybody have opinions on this before I do it?
Rob
More information about the Toybox
mailing list