summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-03-30 01:20:32 +0000
committerHisham Muhammad <hisham@gobolinux.org>2012-03-30 01:20:32 +0000
commit05a78c8111844dafaf8aea329c2b047bffa7f898 (patch)
tree34a353268ebc603cc59a7f3e5384ddfe7e017464 /htop.c
parentbca656c79e184fb044ad9f71c323070d25623486 (diff)
Auto-follow process when selecting which signal to use when killing a process.
This avoids killing the wrong process.
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/htop.c b/htop.c
index 943a7241..b9092d5a 100644
--- a/htop.c
+++ b/htop.c
@@ -207,7 +207,16 @@ static Object* pickFromVector(Panel* panel, Panel* list, int x, int y, const cha
ScreenManager_add(scr, panel, NULL, -1);
Panel* panelFocus;
int ch;
+ bool unfollow = false;
+ if (header->pl->following == -1) {
+ Process* p = (Process*)Panel_getSelected(panel);
+ header->pl->following = p ? p->pid : -1;
+ unfollow = true;
+ }
ScreenManager_run(scr, &panelFocus, &ch);
+ if (unfollow) {
+ header->pl->following = -1;
+ }
ScreenManager_delete(scr);
Panel_move(panel, 0, y);
Panel_resize(panel, COLS, LINES-y-1);

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