317 lines
11 KiB
Diff
317 lines
11 KiB
Diff
diff --git a/Action.c b/Action.c
|
|
index b765248..50b32f5 100644
|
|
--- a/Action.c
|
|
+++ b/Action.c
|
|
@@ -507,7 +507,7 @@ static const struct {
|
|
const char* info;
|
|
} helpLeft[] = {
|
|
{ .key = " Tab: ", .roInactive = false, .info = "switch to next screen tab" },
|
|
- { .key = " Arrows: ", .roInactive = false, .info = "scroll process list" },
|
|
+ { .key = " hjkl: ", .roInactive = false, .info = "scroll process list" },
|
|
{ .key = " Digits: ", .roInactive = false, .info = "incremental PID search" },
|
|
{ .key = " F3 /: ", .roInactive = false, .info = "incremental name search" },
|
|
{ .key = " F4 \\: ", .roInactive = false, .info = "incremental name filtering" },
|
|
@@ -535,7 +535,7 @@ static const struct {
|
|
{ .key = " Space: ", .roInactive = false, .info = "tag process" },
|
|
{ .key = " c: ", .roInactive = false, .info = "tag process and its children" },
|
|
{ .key = " U: ", .roInactive = false, .info = "untag all processes" },
|
|
- { .key = " F9 k: ", .roInactive = true, .info = "kill process/tagged processes" },
|
|
+ { .key = " F9 x: ", .roInactive = true, .info = "kill process/tagged processes" },
|
|
{ .key = " F7 ]: ", .roInactive = true, .info = "higher priority (root only)" },
|
|
{ .key = " F8 [: ", .roInactive = true, .info = "lower priority (+ nice)" },
|
|
#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY))
|
|
@@ -543,12 +543,12 @@ static const struct {
|
|
#endif
|
|
{ .key = " e: ", .roInactive = false, .info = "show process environment" },
|
|
{ .key = " i: ", .roInactive = true, .info = "set IO priority" },
|
|
- { .key = " l: ", .roInactive = true, .info = "list open files with lsof" },
|
|
- { .key = " x: ", .roInactive = false, .info = "list file locks of process" },
|
|
+ { .key = " L: ", .roInactive = true, .info = "list open files with lsof" },
|
|
+ { .key = " X: ", .roInactive = false, .info = "list file locks of process" },
|
|
{ .key = " s: ", .roInactive = true, .info = "trace syscalls with strace" },
|
|
{ .key = " w: ", .roInactive = false, .info = "wrap process command in multiple lines" },
|
|
{ .key = " F2 C S: ", .roInactive = false, .info = "setup" },
|
|
- { .key = " F1 h ?: ", .roInactive = false, .info = "show this help screen" },
|
|
+ { .key = " F1 ?: ", .roInactive = false, .info = "show this help screen" },
|
|
{ .key = " F10 q: ", .roInactive = false, .info = "quit" },
|
|
{ .key = NULL, .info = NULL }
|
|
};
|
|
@@ -747,12 +747,14 @@ void Action_setBindings(Htop_Action* keys) {
|
|
keys['H'] = actionToggleUserlandThreads;
|
|
keys['I'] = actionInvertSortOrder;
|
|
keys['K'] = actionToggleKernelThreads;
|
|
+ keys['L'] = actionLsof;
|
|
keys['M'] = actionSortByMemory;
|
|
keys['N'] = actionSortByPID;
|
|
keys['P'] = actionSortByCPU;
|
|
keys['S'] = actionSetup;
|
|
keys['T'] = actionSortByTime;
|
|
keys['U'] = actionUntagAll;
|
|
+ keys['X'] = actionShowLocks;
|
|
keys['Z'] = actionTogglePauseProcessUpdate;
|
|
keys['['] = actionLowerPriority;
|
|
keys['\014'] = actionRedraw; // Ctrl+L
|
|
@@ -762,17 +764,15 @@ void Action_setBindings(Htop_Action* keys) {
|
|
keys['a'] = actionSetAffinity;
|
|
keys['c'] = actionTagAllChildren;
|
|
keys['e'] = actionShowEnvScreen;
|
|
- keys['h'] = actionHelp;
|
|
- keys['k'] = actionKill;
|
|
- keys['l'] = actionLsof;
|
|
keys['m'] = actionToggleMergedCommand;
|
|
+ keys['o'] = actionExpandCollapseOrSortColumn;
|
|
keys['p'] = actionToggleProgramPath;
|
|
keys['q'] = actionQuit;
|
|
keys['s'] = actionStrace;
|
|
keys['t'] = actionToggleTreeView;
|
|
keys['u'] = actionFilterByUser;
|
|
keys['w'] = actionShowCommandScreen;
|
|
- keys['x'] = actionShowLocks;
|
|
+ keys['x'] = actionKill;
|
|
keys[KEY_F(1)] = actionHelp;
|
|
keys[KEY_F(2)] = actionSetup;
|
|
keys[KEY_F(3)] = actionIncSearch;
|
|
diff --git a/CategoriesPanel.c b/CategoriesPanel.c
|
|
index 6e905ce..e7253ac 100644
|
|
--- a/CategoriesPanel.c
|
|
+++ b/CategoriesPanel.c
|
|
@@ -103,6 +103,12 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
|
|
HandlerResult result = IGNORED;
|
|
|
|
int selected = Panel_getSelectedIndex(super);
|
|
+ switch (ch) {
|
|
+ case 'h': ch = KEY_LEFT; break;
|
|
+ case 'j': ch = KEY_DOWN; break;
|
|
+ case 'k': ch = KEY_UP; break;
|
|
+ case 'l': ch = KEY_RIGHT; break;
|
|
+ }
|
|
switch (ch) {
|
|
case EVENT_SET_SELECTED:
|
|
result = HANDLED;
|
|
diff --git a/MainPanel.c b/MainPanel.c
|
|
index 44915df..4747788 100644
|
|
--- a/MainPanel.c
|
|
+++ b/MainPanel.c
|
|
@@ -51,7 +51,7 @@ static const char* MainPanel_getValue(Panel* this, int i) {
|
|
return Process_getCommand(p);
|
|
}
|
|
|
|
-static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
|
|
+HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
|
|
MainPanel* this = (MainPanel*) super;
|
|
|
|
HandlerResult result = IGNORED;
|
|
diff --git a/MainPanel.h b/MainPanel.h
|
|
index bd22acd..069d0b3 100644
|
|
--- a/MainPanel.h
|
|
+++ b/MainPanel.h
|
|
@@ -47,4 +47,6 @@ void MainPanel_setState(MainPanel* this, State* state);
|
|
|
|
void MainPanel_delete(Object* object);
|
|
|
|
+HandlerResult MainPanel_eventHandler(Panel* super, int ch);
|
|
+
|
|
#endif
|
|
diff --git a/Panel.c b/Panel.c
|
|
index 4ea03f6..83a4acf 100644
|
|
--- a/Panel.c
|
|
+++ b/Panel.c
|
|
@@ -358,6 +358,7 @@ bool Panel_onKey(Panel* this, int key) {
|
|
|
|
switch (key) {
|
|
case KEY_DOWN:
|
|
+ case 'j':
|
|
case KEY_CTRL('N'):
|
|
#ifdef KEY_C_DOWN
|
|
case KEY_C_DOWN:
|
|
@@ -366,6 +367,7 @@ bool Panel_onKey(Panel* this, int key) {
|
|
break;
|
|
|
|
case KEY_UP:
|
|
+ case 'k':
|
|
case KEY_CTRL('P'):
|
|
#ifdef KEY_C_UP
|
|
case KEY_C_UP:
|
|
@@ -374,7 +376,7 @@ bool Panel_onKey(Panel* this, int key) {
|
|
break;
|
|
|
|
case KEY_LEFT:
|
|
- case KEY_CTRL('B'):
|
|
+ case 'h':
|
|
if (this->scrollH > 0) {
|
|
this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0);
|
|
this->needsRedraw = true;
|
|
@@ -382,16 +384,28 @@ bool Panel_onKey(Panel* this, int key) {
|
|
break;
|
|
|
|
case KEY_RIGHT:
|
|
- case KEY_CTRL('F'):
|
|
+ case 'l':
|
|
this->scrollH += CRT_scrollHAmount;
|
|
this->needsRedraw = true;
|
|
break;
|
|
|
|
+ case KEY_CTRL('U'):
|
|
+ this->selected -= (this->h - 1) / 2;
|
|
+ this->needsRedraw = true;
|
|
+ break;
|
|
+
|
|
+ case KEY_CTRL('D'):
|
|
+ this->selected += (this->h - 1) / 2;
|
|
+ this->needsRedraw = true;
|
|
+ break;
|
|
+
|
|
case KEY_PPAGE:
|
|
+ case KEY_CTRL('B'):
|
|
PANEL_SCROLL(-(this->h - Panel_headerHeight(this)));
|
|
break;
|
|
|
|
case KEY_NPAGE:
|
|
+ case KEY_CTRL('F'):
|
|
PANEL_SCROLL(+(this->h - Panel_headerHeight(this)));
|
|
break;
|
|
|
|
@@ -404,10 +418,12 @@ bool Panel_onKey(Panel* this, int key) {
|
|
break;
|
|
|
|
case KEY_HOME:
|
|
+ case 'g':
|
|
this->selected = 0;
|
|
break;
|
|
|
|
case KEY_END:
|
|
+ case 'G':
|
|
this->selected = size - 1;
|
|
break;
|
|
|
|
diff --git a/ScreenManager.c b/ScreenManager.c
|
|
index e4b04bd..d5d7ccd 100644
|
|
--- a/ScreenManager.c
|
|
+++ b/ScreenManager.c
|
|
@@ -16,6 +16,7 @@ in the source distribution for its full text.
|
|
|
|
#include "CRT.h"
|
|
#include "FunctionBar.h"
|
|
+#include "MainPanel.h"
|
|
#include "Macros.h"
|
|
#include "Object.h"
|
|
#include "Platform.h"
|
|
@@ -294,14 +295,16 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, con
|
|
redraw = false;
|
|
continue;
|
|
}
|
|
- switch (ch) {
|
|
- case KEY_ALT('H'): ch = KEY_LEFT; break;
|
|
- case KEY_ALT('J'): ch = KEY_DOWN; break;
|
|
- case KEY_ALT('K'): ch = KEY_UP; break;
|
|
- case KEY_ALT('L'): ch = KEY_RIGHT; break;
|
|
- }
|
|
redraw = true;
|
|
if (Panel_eventHandlerFn(panelFocus)) {
|
|
+ if (Panel_eventHandlerFn(panelFocus) != MainPanel_eventHandler) {
|
|
+ switch (ch) {
|
|
+ case 'h': case KEY_ALT('H'): ch = KEY_LEFT; break;
|
|
+ case 'j': case KEY_ALT('J'): ch = KEY_DOWN; break;
|
|
+ case 'k': case KEY_ALT('K'): ch = KEY_UP; break;
|
|
+ case 'l': case KEY_ALT('L'): ch = KEY_RIGHT; break;
|
|
+ }
|
|
+ }
|
|
result = Panel_eventHandler(panelFocus, ch);
|
|
}
|
|
if (result & SYNTH_KEY) {
|
|
@@ -335,7 +338,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, con
|
|
continue;
|
|
}
|
|
case KEY_LEFT:
|
|
- case KEY_CTRL('B'):
|
|
+ case 'h':
|
|
if (this->panelCount < 2) {
|
|
goto defaultHandler;
|
|
}
|
|
@@ -356,7 +359,7 @@ tryLeft:
|
|
|
|
break;
|
|
case KEY_RIGHT:
|
|
- case KEY_CTRL('F'):
|
|
+ case 'l':
|
|
case 9:
|
|
if (this->panelCount < 2) {
|
|
goto defaultHandler;
|
|
diff --git a/htop.1.in b/htop.1.in
|
|
index c81c819..af5e0b6 100644
|
|
--- a/htop.1.in
|
|
+++ b/htop.1.in
|
|
@@ -100,27 +100,29 @@ The following commands are supported while in
|
|
Select the next / the previous screen tab to display.
|
|
You can enable showing the screen tab names in the Setup screen (F2).
|
|
.TP
|
|
-.B Up, Alt-k
|
|
+.B Up, k
|
|
Select (highlight) the previous process in the process list. Scroll the list
|
|
if necessary.
|
|
.TP
|
|
-.B Down, Alt-j
|
|
+.B Down, j
|
|
Select (highlight) the next process in the process list. Scroll the list if
|
|
necessary.
|
|
.TP
|
|
-.B Left, Alt-h
|
|
+.B Left, h
|
|
Scroll the process list left.
|
|
.TP
|
|
-.B Right, Alt-l
|
|
+.B Right, l
|
|
Scroll the process list right.
|
|
.TP
|
|
-.B PgUp, PgDn
|
|
+.B PgUp, Ctrl-B, PgDn, Ctrl-F
|
|
Scroll the process list up or down one window.
|
|
.TP
|
|
-.B Home
|
|
+.B Ctrl-U, Ctrl-D
|
|
+Scroll the process list up or down half a window.
|
|
+.B Home, g
|
|
Scroll to the top of the process list and select the first process.
|
|
.TP
|
|
-.B End
|
|
+.B End, G
|
|
Scroll to the bottom of the process list and select the last process.
|
|
.TP
|
|
.B Ctrl-A, ^
|
|
@@ -155,7 +157,7 @@ will display the list of file descriptors opened by the process.
|
|
Display the command line of the selected process in a separate screen, wrapped
|
|
onto multiple lines as needed.
|
|
.TP
|
|
-.B x
|
|
+.B X
|
|
Display the active file locks of the selected process in a separate screen.
|
|
.TP
|
|
.B F1, h, ?
|
|
@@ -189,7 +191,7 @@ between them as a tree. Toggling the key will switch between tree and
|
|
your previously selected sort view. Selecting a sort view will exit
|
|
tree view.
|
|
.TP
|
|
-.B F6, <, >
|
|
+.B F6, <, >, o
|
|
Selects a field for sorting, also accessible through < and >.
|
|
The current sort field is indicated by a highlight in the header.
|
|
.TP
|
|
@@ -207,7 +209,7 @@ This can only be done by the superuser.
|
|
.B Shift-F8, {
|
|
Decrease the selected process's autogroup priority (add to autogroup 'nice' value)
|
|
.TP
|
|
-.B F9, k
|
|
+.B F9, x
|
|
"Kill" process: sends a signal which is selected in a menu, to one or a group
|
|
of processes. If processes were tagged, sends the signal to all tagged processes.
|
|
If none is tagged, sends to the currently selected process.
|
|
@@ -219,7 +221,7 @@ Quit
|
|
Invert the sort order: if sort order is increasing, switch to decreasing, and
|
|
vice-versa.
|
|
.TP
|
|
-.B +, \-, *
|
|
+.B +, \-, *, o
|
|
When in tree view mode, expand or collapse subtree. When a subtree is collapsed
|
|
a "+" sign shows to the left of the process name.
|
|
Pressing "*" will expand or collapse all children of PIDs without parents, so
|