summaryrefslogtreecommitdiffstats
path: root/Action.c
diff options
context:
space:
mode:
authorMichael Klein <michael.klein@puffin.lb.shuttle.de>2015-12-02 22:58:22 +0100
committerMichael Klein <michael.klein@puffin.lb.shuttle.de>2015-12-02 23:26:00 +0100
commit0919ea32f91bb2ddf349c1108f6f0f67b511cca6 (patch)
tree0d9d7e9906fed1f9e55c617e0c2c851c1e6f0574 /Action.c
parent670a2de6921e00e4768375b2636fa94e5ce663fd (diff)
'e' displays environment of current process
- uses sysctl(KERN_PROCARGS2) on *BSD - doesn't work on Linux yet
Diffstat (limited to 'Action.c')
-rw-r--r--Action.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Action.c b/Action.c
index 6c387def..6fa26e9b 100644
--- a/Action.c
+++ b/Action.c
@@ -12,6 +12,7 @@ in the source distribution for its full text.
#include "AffinityPanel.h"
#include "CategoriesPanel.h"
#include "CRT.h"
+#include "EnvScreen.h"
#include "MainPanel.h"
#include "OpenFilesScreen.h"
#include "Process.h"
@@ -404,6 +405,7 @@ static struct { const char* key; const char* info; } helpRight[] = {
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
{ .key = " a: ", .info = "set CPU affinity" },
#endif
+ { .key = " e: ", .info = "show process environment" },
{ .key = " i: ", .info = "set IO prority" },
{ .key = " l: ", .info = "list open files with lsof" },
{ .key = " s: ", .info = "trace syscalls with strace" },
@@ -499,6 +501,18 @@ static Htop_Reaction actionTagAllChildren(State* st) {
return HTOP_OK;
}
+static Htop_Reaction actionShowEnvScreen(State* st) {
+ Process* p = (Process*) Panel_getSelected(st->panel);
+ if (!p) return HTOP_OK;
+ EnvScreen* ts = EnvScreen_new(p);
+ EnvScreen_run(ts);
+ EnvScreen_delete(ts);
+ clear();
+ CRT_enableDelay();
+ return HTOP_REFRESH | HTOP_REDRAW_BAR;
+}
+
+
void Action_setBindings(Htop_Action* keys) {
keys[KEY_RESIZE] = actionResize;
keys['M'] = actionSortByMemory;
@@ -548,5 +562,6 @@ void Action_setBindings(Htop_Action* keys) {
keys['?'] = actionHelp;
keys['U'] = actionUntagAll;
keys['c'] = actionTagAllChildren;
+ keys['e'] = actionShowEnvScreen;
}

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