Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
05a78c81
Commit
05a78c81
authored
Mar 30, 2012
by
Hisham Muhammad
Browse files
Auto-follow process when selecting which signal to use when killing a process.
This avoids killing the wrong process.
parent
bca656c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
ProcessList.c
View file @
05a78c81
...
...
@@ -236,6 +236,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable) {
this
->
detailedCPUTime
=
false
;
this
->
countCPUsFromZero
=
false
;
this
->
treeStr
=
NULL
;
this
->
following
=
-
1
;
return
this
;
}
...
...
@@ -915,7 +916,7 @@ void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool
}
int
currPos
=
Panel_getSelectedIndex
(
this
->
panel
);
pid_t
currPid
=
following
?
following
:
0
;
pid_t
currPid
=
following
!=
-
1
?
following
:
0
;
int
currScrollV
=
this
->
panel
->
scrollV
;
Panel_prune
(
this
->
panel
);
...
...
htop.c
View file @
05a78c81
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment