top: allow collapsible forest view children, pgm logic

The issue cited below really dealt with preserving the
'Other filter' criteria in the rcfile. But as an aside
the htop 'F6' feature (collapsed children) was raised.

I took that as an implied challenge and decided to try
implementing a similar feature in top. So, this commit
will now provide a brand new forest view toggle ('^V')
which will be used to collapse/expand forked children.

[ this patch will also lead to additional patches in ]
[ support of more rational vertical scrolling, since ]
[ many more tasks might now be hidden in some window ]

Reference(s):
. where this secondary issue was raised
https://gitlab.com/procps-ng/procps/issues/99

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2018-06-20 00:00:00 -05:00
committed by Craig Small
parent c88ff1782c
commit 42e8abec0d
4 changed files with 120 additions and 33 deletions

View File

@@ -48,6 +48,8 @@
//#define TERMIOS_ONLY /* just limp along with native input only */
//#define TREE_NORESET /* sort keys do NOT force forest view OFF */
//#define TREE_SCANALL /* rescan array w/ forest view, avoid sort */
//#define TREE_VPROMPT /* pid collapse/expand prompt, vs. top row */
//#define TREE_VWINALL /* pid collapse/expand impacts all windows */
//#define USE_X_COLHDR /* emphasize header vs. whole col, for 'x' */
//#define VALIDATE_NLS /* validate the integrity of all nls tbls */
//#define VER_J_RCFILE /* increase # of fields, rcfile ver to 'j' */
@@ -151,6 +153,7 @@ char *strcasestr(const char *haystack, const char *needle);
#define kbd_INS 138
#define kbd_DEL 139
#define kbd_CtrlO '\017'
#define kbd_CtrlV '\026'
/* Special value in Pseudo_row to force an additional procs refresh
-- used at startup and for task/thread mode transitions */