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:
50
top/top.c
50
top/top.c
@ -4921,6 +4921,29 @@ static void keys_task (int ch) {
|
||||
? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)));
|
||||
}
|
||||
break;
|
||||
case 'v':
|
||||
if (VIZCHKw(w)) {
|
||||
if (CHKw(w, Show_FOREST)) {
|
||||
int i, pid = PID_VAL(EU_PID, s_int, w->ppt[w->begtask]);
|
||||
#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':
|
||||
if (VIZCHKw(w)) {
|
||||
#ifdef USE_X_COLHDR
|
||||
@ -4952,29 +4975,6 @@ static void keys_task (int ch) {
|
||||
capsmk(w);
|
||||
}
|
||||
break;
|
||||
case kbd_CtrlV:
|
||||
if (VIZCHKw(w)) {
|
||||
if (CHKw(w, Show_FOREST)) {
|
||||
int i, pid = PID_VAL(EU_PID, s_int, w->ppt[w->begtask]);
|
||||
#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
|
||||
break;
|
||||
}
|
||||
@ -5181,8 +5181,8 @@ static void do_key (int ch) {
|
||||
{ '1', '2', '3', 'C', 'l', 'm', 't', '\0' } },
|
||||
{ keys_task,
|
||||
{ '#', '<', '>', 'b', 'c', 'i', 'J', 'j', 'n', 'O', 'o'
|
||||
, 'R', 'S', 'U', 'u', 'V', 'x', 'y', 'z'
|
||||
, kbd_CtrlO, kbd_CtrlV, '\0' } },
|
||||
, 'R', 'S', 'U', 'u', 'V', 'v', 'x', 'y', 'z'
|
||||
, kbd_CtrlO, '\0' } },
|
||||
{ keys_window,
|
||||
{ '+', '-', '=', '_', '&', 'A', 'a', 'G', 'L', 'w'
|
||||
, kbd_UP, kbd_DOWN, kbd_LEFT, kbd_RIGHT, kbd_PGUP, kbd_PGDN
|
||||
|
Reference in New Issue
Block a user