summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2022-05-19 22:03:12 +0200
committerDaniel Lange <DLange@git.local>2022-05-20 12:30:37 +0200
commit37e01cbe33714c8fde72220555b92c7d8585d127 (patch)
tree44f5fcce5adec215053f97d5cee3f9793e555ac0
parentd22667725a980e75a3c635567ec5c9400bcde02b (diff)
Colorize process state characters in help screen
Thanks to @Low-power for the idea Closes #1010
-rw-r--r--Action.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Action.c b/Action.c
index 27a9ef5d..5aabcc3f 100644
--- a/Action.c
+++ b/Action.c
@@ -618,9 +618,23 @@ static Htop_Reaction actionHelp(State* st) {
}
line++;
- mvaddstr(line++, 0, "Process state: R: running; S: sleeping; T: traced/stopped; Z: zombie; D: disk sleep");
+#define addattrstatestr(attr, state, desc) \
+ do { \
+ addattrstr(attr, state); \
+ addattrstr(CRT_colors[DEFAULT_COLOR], ": " desc); \
+ } while(0)
+
+ mvaddstr(line, 0, "Process state: ");
+ addattrstatestr(CRT_colors[PROCESS_RUN_STATE], "R", "running; ");
+ addattrstatestr(CRT_colors[PROCESS_SHADOW], "S", "sleeping; ");
+ addattrstatestr(CRT_colors[PROCESS_RUN_STATE], "t", "traced/stopped; ");
+ addattrstatestr(CRT_colors[PROCESS_D_STATE], "Z", "zombie; ");
+ addattrstatestr(CRT_colors[PROCESS_D_STATE], "D", "dist sleep");
+ attrset(CRT_colors[DEFAULT_COLOR]);
- line++;
+#undef addattrstatestr
+
+ line += 2;
const bool readonly = Settings_isReadonly();

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