summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Mannens <jakem_5@hotmail.com>2020-12-20 01:48:07 +1100
committerDaniel Lange <DLange@git.local>2020-12-23 18:30:26 +0100
commitf1463fdd6429c670c61c0f790e9545d822a3c1ce (patch)
tree208f0f833f23d1dc87635c75c61d89ec5d433439
parent3edb6e1ea3fc7434585528d21da1f2f86bb34d1b (diff)
Added keybind 'N' for sorting by PID
-rw-r--r--Action.c7
-rw-r--r--htop.1.in3
2 files changed, 9 insertions, 1 deletions
diff --git a/Action.c b/Action.c
index 32ea544a..206eb675 100644
--- a/Action.c
+++ b/Action.c
@@ -195,6 +195,10 @@ static Htop_Reaction actionResize(State* st) {
return HTOP_REDRAW_BAR;
}
+static Htop_Reaction actionSortByPID(State* st) {
+ return Action_setSortKey(st->settings, PID);
+}
+
static Htop_Reaction actionSortByMemory(State* st) {
return Action_setSortKey(st->settings, PERCENT_MEM);
}
@@ -452,7 +456,7 @@ static const struct {
{ .key = " K: ", .info = "hide/show kernel threads" },
{ .key = " F: ", .info = "cursor follows process" },
{ .key = " + -: ", .info = "expand/collapse tree" },
- { .key = " P M T: ", .info = "sort by CPU%, MEM% or TIME" },
+ { .key = "N P M T: ", .info = "sort by PID, CPU%, MEM% or TIME" },
{ .key = " I: ", .info = "invert sort order" },
{ .key = " F6 > .: ", .info = "select sort column" },
{ .key = NULL, .info = NULL }
@@ -645,6 +649,7 @@ void Action_setBindings(Htop_Action* keys) {
keys['I'] = actionInvertSortOrder;
keys['K'] = actionToggleKernelThreads;
keys['M'] = actionSortByMemory;
+ keys['N'] = actionSortByPID;
keys['P'] = actionSortByCPU;
keys['S'] = actionSetup;
keys['T'] = actionSortByTime;
diff --git a/htop.1.in b/htop.1.in
index 9a1fe3f8..84ff5f82 100644
--- a/htop.1.in
+++ b/htop.1.in
@@ -184,6 +184,9 @@ Set CPU affinity: mark which CPUs a process is allowed to use.
.B u
Show only processes owned by a specified user.
.TP
+.B N
+Sort by PID.
+.TP
.B M
Sort by memory usage (top compatibility key).
.TP

© 2014-2024 Faster IT GmbH | imprint | privacy policy