top: '^V' is now 'v' (collapse/expand children toggle)

Using Ctrl-V for the collapse children key now appears
as a mistake. First, it's too close to that Ctrl-C key
which would prematurely terminate top. Second, a lower
case 'v' was unused and perfectly compliments an upper
case 'V' which is used to toggle 'forest view' itself.

Reference(s):
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-07-10 00:00:00 -05:00 committed by Craig Small
parent 8c9daf45ab
commit 8626141d8f
4 changed files with 34 additions and 35 deletions

View File

@ -603,10 +603,10 @@ divided by the total number of \*(PUs.
You toggle Irix/Solaris modes with the `I' \*(CI. You toggle Irix/Solaris modes with the `I' \*(CI.
\*(NT When running in forest view mode (`V') with children \*(NT When running in forest view mode (`V') with children
collapsed (`^V'), this field will also include the \*(PU time of collapsed (`v'), this field will also include the \*(PU time of
those unseen children. those unseen children.
\*(XT 4c. TASK AREA Commands, CONTENT for more information regarding \*(XT 4c. TASK AREA Commands, CONTENT for more information regarding
the `V' and `^V' toggles. the `V' and `v' toggles.
.TP 4 .TP 4
2.\fB %MEM \*(Em Memory Usage (RES) \fR 2.\fB %MEM \*(Em Memory Usage (RES) \fR
@ -1108,7 +1108,7 @@ depending on the context in which they are issued.
C, l, t, m, 1, 2, 3 C, l, t, m, 1, 2, 3
4c.\fI Task-Area-Commands \fR 4c.\fI Task-Area-Commands \fR
Appearance: b, J, j, x, y, z Appearance: b, J, j, x, y, z
Content: c, f, F, o, O, S, u, U, V, ^V Content: c, f, F, o, O, S, u, U, V, v
Size: #, i, n Size: #, i, n
Sorting: <, >, f, F, R Sorting: <, >, f, F, R
4d.\fI Color-Mapping \fR 4d.\fI Color-Mapping \fR
@ -1154,7 +1154,7 @@ those \*(CIs applicable to \*(AM.
\ \ \ \fB=\fR\ \ :\fIExit-Task-Limits \fR \ \ \ \fB=\fR\ \ :\fIExit-Task-Limits \fR
Removes restrictions on which tasks are shown. Removes restrictions on which tasks are shown.
This command will reverse any `i' (idle tasks), `n' (max tasks) This command will reverse any `i' (idle tasks), `n' (max tasks)
and `^V' (hide children) commands that might be active. and `v' (hide children) commands that might be active.
It also provides for an exit from PID monitoring, User filtering, It also provides for an exit from PID monitoring, User filtering,
Other filtering and Locate processing. Other filtering and Locate processing.
@ -1588,7 +1588,7 @@ mode in the \*(CW.
\*(XT 4c. TASK AREA Commands, SORTING for information on those keys. \*(XT 4c. TASK AREA Commands, SORTING for information on those keys.
.TP 7 .TP 7
\ \ \fB^V\fR\ \ :\fIHide/Show-Children\fR toggle (Ctrl key + `V') \fR \ \ \ \fBv\fR\ \ :\fIHide/Show-Children\fR toggle \fR
When in forest view mode, this key serves as a toggle to collapse or When in forest view mode, this key serves as a toggle to collapse or
expand the children of a parent. expand the children of a parent.
@ -1774,7 +1774,7 @@ as the only display element.
*\ \ \fB=\fR | \fB+\fR\ \ :\fIEqualize-(reinitialize)-Window(s) \fR *\ \ \fB=\fR | \fB+\fR\ \ :\fIEqualize-(reinitialize)-Window(s) \fR
The `=' key forces the \*(CW's \*(TD to be visible. The `=' key forces the \*(CW's \*(TD to be visible.
It also reverses any active `i' (idle tasks), `n' (max tasks), `u/U' It also reverses any active `i' (idle tasks), `n' (max tasks), `u/U'
(user filter), `o/O' (other filter), `^V' (hide children) and 'L' (locate) (user filter), `o/O' (other filter), `v' (hide children) and 'L' (locate)
commands. commands.
Also, if the window had been scrolled, it will be reset with this command. Also, if the window had been scrolled, it will be reset with this command.
\*(XT 5c. SCROLLING a Window for additional information regarding vertical \*(XT 5c. SCROLLING a Window for additional information regarding vertical
@ -1784,7 +1784,7 @@ The `+' key does the same for all windows.
The four \*(TDs will reappear, evenly balanced. The four \*(TDs will reappear, evenly balanced.
They will also have retained any customizations you had previously They will also have retained any customizations you had previously
applied, except for the `i' (idle tasks), `n' (max tasks), `u/U' applied, except for the `i' (idle tasks), `n' (max tasks), `u/U'
(user filter), `o/O' (other filter), `^V' (hide children), `L' (locate) (user filter), `o/O' (other filter), `v' (hide children), `L' (locate)
and scrolling \*(CIs. and scrolling \*(CIs.
.TP 7 .TP 7

View File

@ -5351,6 +5351,29 @@ static void keys_task (int ch) {
? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt))); ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)));
} }
break; break;
case 'v':
if (VIZCHKw(w)) {
if (CHKw(w, Show_FOREST)) {
int i, pid = w->ppt[w->begtask]->tid;
#ifdef TREE_VPROMPT
int got = get_int(fmtmk(N_txt(XTRA_vforest_fmt), pid));
if (got < GET_NUM_NOT) break;
if (got > GET_NUM_NOT) pid = got;
#endif
for (i = 0; i < Hide_tot; i++) {
if (Hide_pid[i] == pid || Hide_pid[i] == -pid) {
Hide_pid[i] = -Hide_pid[i];
break;
}
}
if (i == Hide_tot) Hide_pid[Hide_tot++] = pid;
// plenty of room, but if everything's expanded let's reset ...
for (i = 0; i < Hide_tot; i++)
if (Hide_pid[i] > 0) break;
if (i == Hide_tot) Hide_tot = 0;
}
}
break;
case 'x': case 'x':
if (VIZCHKw(w)) { if (VIZCHKw(w)) {
#ifdef USE_X_COLHDR #ifdef USE_X_COLHDR
@ -5382,29 +5405,6 @@ static void keys_task (int ch) {
capsmk(w); capsmk(w);
} }
break; break;
case kbd_CtrlV:
if (VIZCHKw(w)) {
if (CHKw(w, Show_FOREST)) {
int i, pid = w->ppt[w->begtask]->tid;
#ifdef TREE_VPROMPT
int got = get_int(fmtmk(N_txt(XTRA_vforest_fmt), pid));
if (got < GET_NUM_NOT) break;
if (got > GET_NUM_NOT) pid = got;
#endif
for (i = 0; i < Hide_tot; i++) {
if (Hide_pid[i] == pid || Hide_pid[i] == -pid) {
Hide_pid[i] = -Hide_pid[i];
break;
}
}
if (i == Hide_tot) Hide_pid[Hide_tot++] = pid;
// plenty of room, but if everything's expanded let's reset ...
for (i = 0; i < Hide_tot; i++)
if (Hide_pid[i] > 0) break;
if (i == Hide_tot) Hide_tot = 0;
}
}
break;
default: // keep gcc happy default: // keep gcc happy
break; break;
} }
@ -5611,8 +5611,8 @@ static void do_key (int ch) {
{ '1', '2', '3', 'C', 'l', 'm', 't', '\0' } }, { '1', '2', '3', 'C', 'l', 'm', 't', '\0' } },
{ keys_task, { keys_task,
{ '#', '<', '>', 'b', 'c', 'i', 'J', 'j', 'n', 'O', 'o' { '#', '<', '>', 'b', 'c', 'i', 'J', 'j', 'n', 'O', 'o'
, 'R', 'S', 'U', 'u', 'V', 'x', 'y', 'z' , 'R', 'S', 'U', 'u', 'V', 'v', 'x', 'y', 'z'
, kbd_CtrlO, kbd_CtrlV, '\0' } }, , kbd_CtrlO, '\0' } },
{ keys_window, { keys_window,
{ '+', '-', '=', '_', '&', 'A', 'a', 'G', 'L', 'w' { '+', '-', '=', '_', '&', 'A', 'a', 'G', 'L', 'w'
, kbd_UP, kbd_DOWN, kbd_LEFT, kbd_RIGHT, kbd_PGUP, kbd_PGDN , kbd_UP, kbd_DOWN, kbd_LEFT, kbd_RIGHT, kbd_PGUP, kbd_PGDN

View File

@ -175,7 +175,6 @@ char *strcasestr(const char *haystack, const char *needle);
#define kbd_INS 138 #define kbd_INS 138
#define kbd_DEL 139 #define kbd_DEL 139
#define kbd_CtrlO '\017' #define kbd_CtrlO '\017'
#define kbd_CtrlV '\026'
/* Special value in Pseudo_row to force an additional procs refresh /* Special value in Pseudo_row to force an additional procs refresh
-- used at startup and for task/thread mode transitions */ -- used at startup and for task/thread mode transitions */

View File

@ -553,13 +553,13 @@ static void build_uniq_nlstab (void) {
" f,F,X Fields: '~1f~2'/'~1F~2' add/remove/order/sort; '~1X~2' increase fixed-width\n" " f,F,X Fields: '~1f~2'/'~1F~2' add/remove/order/sort; '~1X~2' increase fixed-width\n"
"\n" "\n"
" L,&,<,> . Locate: '~1L~2'/'~1&~2' find/again; Move sort column: '~1<~2'/'~1>~2' left/right\n" " L,&,<,> . Locate: '~1L~2'/'~1&~2' find/again; Move sort column: '~1<~2'/'~1>~2' left/right\n"
" R,H,V,J . Toggle: '~1R~2' Sort; '~1H~2' Threads; '~1V~2' Forest view; '~1J~2' Num justify\n" " R,H,J,C . Toggle: '~1R~2' Sort; '~1H~2' Threads; '~1J~2' Num justify; '~1C~2' Coordinates\n"
" c,i,S,j . Toggle: '~1c~2' Cmd name/line; '~1i~2' Idle; '~1S~2' Time; '~1j~2' Str justify\n" " c,i,S,j . Toggle: '~1c~2' Cmd name/line; '~1i~2' Idle; '~1S~2' Time; '~1j~2' Str justify\n"
" x~5,~1y~5 . Toggle highlights: '~1x~2' sort field; '~1y~2' running tasks\n" " x~5,~1y~5 . Toggle highlights: '~1x~2' sort field; '~1y~2' running tasks\n"
" z~5,~1b~5 . Toggle: '~1z~2' color/mono; '~1b~2' bold/reverse (only if 'x' or 'y')\n" " z~5,~1b~5 . Toggle: '~1z~2' color/mono; '~1b~2' bold/reverse (only if 'x' or 'y')\n"
" u,U,o,O . Filter by: '~1u~2'/'~1U~2' effective/any user; '~1o~2'/'~1O~2' other criteria\n" " u,U,o,O . Filter by: '~1u~2'/'~1U~2' effective/any user; '~1o~2'/'~1O~2' other criteria\n"
" n,#,^O . Set: '~1n~2'/'~1#~2' max tasks displayed; Show: ~1Ctrl~2+'~1O~2' other filter(s)\n" " n,#,^O . Set: '~1n~2'/'~1#~2' max tasks displayed; Show: ~1Ctrl~2+'~1O~2' other filter(s)\n"
" C,^V . Toggle: '~1C~2' coordinates; ~1Ctrl~2+'~1V~2' hide/show forest view children\n" " V,v . Toggle: '~1V~2' forest view; '~1v~2' hide/show forest view children\n"
"\n" "\n"
"%s" "%s"
" W,Y Write configuration file '~1W~2'; Inspect other output '~1Y~2'\n" " W,Y Write configuration file '~1W~2'; Inspect other output '~1Y~2'\n"