-
-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow sorting just once / pausing sorting #921
Comments
Press |
But I do want to see the updated data. I just don't want the re-sorting. |
What @eyalroz requests is a hotkey to temporarily disable sorting. This way user can tag processes without disruptions from new processes or threads inserted into the list (they will be appended to the bottom of the list instead). |
That would get very messy. You would not be shown a consistent state any more because you want to assess e.g. "memory consumption" and the stuff you really should look at is piling up newly at the bottom of the list (whatever bottom of a list in a tree would be). I am not convinced this is a useful request for real-world use cases. /DLange |
@Explorer09 : Hmm. Yeah. I guess that's the proper way to implement this. Indeed, you need sorting enabled in the options to choose the sort order, so whatever key you press is indeed like pausing sorting. To directly implement what I asked for would mean no-sorting by default, then a button which makes you select what to sort by just-once. So, adjusting the title accordingly. @fasterit : The use case is that you've found some problematic process due to sorting, and now you want to follow its behavior. At the moment, to do this, you have to:
with my suggestion all of this would be a single-key. About it being a "non-consistent view" - the state of sort-pausing could be indicated somehow. Example : A color change for the sort "key" on the bottom command bar (make it reddish, or gray it out, or add hatching etc). |
That single key solution already exists, |
@eyalroz It's easy to indicate whether sorting is disabled. Just highlight no sort key (table column header) at all. |
You know that the tree view in recent versions is sorted? |
@Explorer09 : What BenBE said; why wouldn't it apply to tree view?... |
This needs to be handled a bit differently in tree view because tree view (after #893 at least) sorts the tree. Also note that this can be much less useful in tree mode, because tree will still shift due to processes disappearing / appearing in branches above the point you're interested in, and the typical number of processes in that area is probably much higher than in flat mode. |
Well, it seems that @tanriol has answered it to me. New processes can be created in every branch of the tree, making the disable sorting feature less useful than it can possibly be. What eyalroz wants is that when sorting is disabled, new processes would be added to the end of the list, right? |
If it's a flat list, then yes; if it's a tree - added to the end of their parent process' children.
... which should happen even without sorting. So I'm not sure why that makes the feature less useful in tree mode. |
I normally use htop in tree mode sorted by memory and often see the situation when I want to look at some branch, but there's a branch somewhere above it (because at the common level its ancestor uses more RAM) that's actively compiling code, with process counts fluctuating between 5-6 and 40 or so. That results in processes jumping around, yes, and that would still be a problem with paused sorting because they'll still appear/disappear in the same branch above. |
That's true... but you could collapse the subtree of the top items and this problem would go away; and if you also had a summing-collapse (#920 ), you could track the overall memory usage of all subprocesses. |
Just want to chime in here and say that it was totally counter-intuitive to me that processes are sorted in tree view, and while I can see the utility, it would be great to be able to restore the old functionality, which is tree view with no sort. I'm going to try to remember "shift+n" to sort by PID, because that seems to be close enough. |
The old behavior wasn't actually to do a stable sort, but to use the random order the processes had internally. Starting a new process could have (in theory) messed up the whole tree. With the new behavior this sorting is stable and sorting the tree (siblings) by PID is the default. |
When processes have been sorted for me according to some order, I often want to do something with these processes, or just look at their data, without them moving elsewhere... which is what happens in sorted mode once every few seconds. A process often disappears from the terminal entirely, e.g. because a top process has many threads/subprocesses or due to high variation of resource usage.
So, I want to be able to have the sort function fire only once rather than on every update. Of course, on-every-update is also a valid and popular mode of use, so perhaps an option to choose between these two kinds of behaviors, or different keyboard shortcuts etc.
The text was updated successfully, but these errors were encountered: