Skip to content

Instantly share code, notes, and snippets.

@ahodesuka
Created October 12, 2017 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahodesuka/6baff8b266cf6686fb81fcaa99f00653 to your computer and use it in GitHub Desktop.
Save ahodesuka/6baff8b266cf6686fb81fcaa99f00653 to your computer and use it in GitHub Desktop.
--- htop-2.0.2/Action.c 2017-10-12 08:21:24.972040580 -0500
+++ htop-2.0.2/Action.c 2017-10-12 08:26:08.740240696 -0500
@@ -382,7 +382,7 @@ static Htop_Reaction actionRedraw() {
}
static struct { const char* key; const char* info; } helpLeft[] = {
- { .key = " Arrows: ", .info = "scroll process list" },
+ { .key = " hjkl: ", .info = "scroll process list" },
{ .key = " Digits: ", .info = "incremental PID search" },
{ .key = " F3 /: ", .info = "incremental name search" },
{ .key = " F4 \\: ",.info = "incremental name filtering" },
@@ -403,7 +403,7 @@ static struct { const char* key; const c
{ .key = " Space: ", .info = "tag process" },
{ .key = " c: ", .info = "tag process and its children" },
{ .key = " U: ", .info = "untag all processes" },
- { .key = " F9 k: ", .info = "kill process/tagged processes" },
+ { .key = " F9 d: ", .info = "kill process/tagged processes" },
{ .key = " F7 ]: ", .info = "higher priority (root only)" },
{ .key = " F8 [: ", .info = "lower priority (+ nice)" },
#if (HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY)
@@ -415,7 +415,7 @@ static struct { const char* key; const c
{ .key = " s: ", .info = "trace syscalls with strace" },
{ .key = " ", .info = "" },
{ .key = " F2 S: ", .info = "setup" },
- { .key = " F1 h: ", .info = "show this help screen" },
+ { .key = " F1 ?: ", .info = "show this help screen" },
{ .key = " F10 q: ", .info = "quit" },
{ .key = NULL, .info = NULL }
};
@@ -551,7 +551,7 @@ void Action_setBindings(Htop_Action* key
keys['q'] = actionQuit;
keys['a'] = actionSetAffinity;
keys[KEY_F(9)] = actionKill;
- keys['k'] = actionKill;
+ keys['d'] = actionKill;
keys[KEY_RECLICK] = actionExpandOrCollapse;
keys['+'] = actionExpandOrCollapse;
keys['='] = actionExpandOrCollapse;
@@ -561,12 +561,11 @@ void Action_setBindings(Htop_Action* key
keys['S'] = actionSetup;
keys['C'] = actionSetup;
keys[KEY_F(2)] = actionSetup;
- keys['l'] = actionLsof;
+ keys['L'] = actionLsof;
keys['s'] = actionStrace;
keys[' '] = actionTag;
keys['\014'] = actionRedraw; // Ctrl+L
keys[KEY_F(1)] = actionHelp;
- keys['h'] = actionHelp;
keys['?'] = actionHelp;
keys['U'] = actionUntagAll;
keys['c'] = actionTagAllChildren;
--- htop-2.0.2/Panel.c 2017-10-12 08:18:22.514122676 -0500
+++ htop-2.0.2/Panel.c 2017-10-12 08:27:08.178234362 -0500
@@ -376,10 +376,12 @@ bool Panel_onKey(Panel* this, int key) {
int size = Vector_size(this->items);
switch (key) {
case KEY_DOWN:
+ case 'j':
case KEY_CTRL('N'):
this->selected++;
break;
case KEY_UP:
+ case 'k':
case KEY_CTRL('P'):
this->selected--;
break;
@@ -394,6 +396,7 @@ bool Panel_onKey(Panel* this, int key) {
break;
#endif
case KEY_LEFT:
+ case 'h':
case KEY_CTRL('B'):
if (this->scrollH > 0) {
this->scrollH -= MAX(CRT_scrollHAmount, 0);
@@ -401,6 +404,7 @@ bool Panel_onKey(Panel* this, int key) {
}
break;
case KEY_RIGHT:
+ case 'l':
case KEY_CTRL('F'):
this->scrollH += CRT_scrollHAmount;
this->needsRedraw = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment