summaryrefslogtreecommitdiffstats
path: root/Action.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-01-12 02:55:43 -0200
committerHisham Muhammad <hisham@gobolinux.org>2016-01-12 02:55:43 -0200
commit032af1577c4bd58cc7c76f3455afe3e1b22a4b9a (patch)
tree3288a07433d988062afc4f0be4335e07760c33fa /Action.c
parentd850803eb8401cb63e452e4a247be3b4a6d92313 (diff)
parentb14f89e9d42f314ce964a500df842364770b06ee (diff)
Merge branch 'envscreen' of https://github.com/mklein-de/htop into mklein-de-envscreen
Diffstat (limited to 'Action.c')
-rw-r--r--Action.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/Action.c b/Action.c
index 97fe55ac..e60a7f23 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,7 +405,8 @@ static struct { const char* key; const char* info; } helpRight[] = {
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
{ .key = " a: ", .info = "set CPU affinity" },
#endif
- { .key = " i: ", .info = "set IO priority" },
+ { .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" },
{ .key = " ", .info = "" },
@@ -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