Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Automatically follow on process accross tree view / sort order changes#146

Open
cben wants to merge 2 commits intohishamhm:masterfrom
cben:tree-follow
Open

Automatically follow on process accross tree view / sort order changes#146
cben wants to merge 2 commits intohishamhm:masterfrom
cben:tree-follow

Conversation

@cben
Copy link
Copy Markdown

@cben cben commented Nov 15, 2014

The first commit closes #51. I think that's a clear win - it's useful to follow a busy process to/from tree view to find its children/parent, and I can't think of any use for staying at the same screen position.
It also keeps following after the switch. Let me know if you prefer to restore follow=false afterwards, but I think that'd be worse - e.g. going from tree view to CPU sort (which jumps around a lot), you'd follow the current process only to lose it a second later.

The second commit also enables following on any sort order change (if I covered all code paths that do that...).
I'm not sure that's always desired. The main use case for not following is staying at the top of the screen to look at worse offenders for each resource (which is certainly common use of top!). But if following is default, one can always go to top of the list with Home, whereas if you have to press F before switching but forgot, there is no easy way to undo losing the selected process.
The most dubious case is following on inverting sort order (I) — the likely reason to press it is wanting to look at opposite processes, not same process on other end of screen...

Finally, if you like both changes, the continue vs break structure (the latter implying follow = false;) is IMHO getting messy.
It made more sense when most cases that did change it were to false, but now it's more symmetric.
I'd refactor to explicitly assigning false/true in every case that changes it — let me know what you prefer.

P.S. Thanks for htop, it's the first thing I install on every machine I use!

cben added 2 commits November 15, 2014 19:17
Following stays on afterward (until movement), which I think is a feature:
consider switching from tree view to CPU - what was the point following
a process from tree view if we let it jump around after a second?
@hishamhm
Copy link
Copy Markdown
Owner

Thanks! I'm in the middle of some major reorganization of the code, but I'll keep this in mind and will rethink the "follow" logic taking your ideas into account!

@cben
Copy link
Copy Markdown
Author

cben commented Oct 1, 2015

Any news on the reorganization?
I just compiled from HEAD and see that by default changing sort/tree still doesn't follow.
Would you like an updated PR?

@hishamhm
Copy link
Copy Markdown
Owner

hishamhm commented Oct 5, 2015

Hi, yes, an updated PR would be great. The code is really different now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Processes are not followed correctly

2 participants