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
Open
Automatically follow on process accross tree view / sort order changes#146cben wants to merge 2 commits intohishamhm:masterfrom
cben wants to merge 2 commits intohishamhm:masterfrom
Conversation
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?
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! |
Author
|
Any news on the reorganization? |
Owner
|
Hi, yes, an updated PR would be great. The code is really different now! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 pressFbefore 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
continuevsbreakstructure (the latter implyingfollow = 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!