mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Option and key ("*") to collapse / expand all branches under PID 1
(and PID 2 if kernel threads are shown) Based on hishamhm/htop#510 by Krishna Chaitanya, B Closes #68
This commit is contained in:
@ -494,6 +494,16 @@ void ProcessList_expandTree(ProcessList* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessList_collapseAllBranches(ProcessList* this) {
|
||||
int size = Vector_size(this->processes);
|
||||
for (int i = 0; i < size; i++) {
|
||||
Process* process = (Process*) Vector_get(this->processes, i);
|
||||
// FreeBSD has pid 0 = kernel and pid 1 = init, so init has tree_depth = 1
|
||||
if (process->tree_depth > 0 && process->pid > 1)
|
||||
process->showChildren = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessList_rebuildPanel(ProcessList* this) {
|
||||
const char* incFilter = this->incFilter;
|
||||
|
||||
|
Reference in New Issue
Block a user