Stable tree view#1957
Merged
BenBE merged 4 commits intohtop-dev:mainfrom May 3, 2026
Merged
Conversation
|
This is great! Should there be a command-line option? |
Member
Author
|
I like the idea, but I added it as an optional argument to |
BenBE
reviewed
May 2, 2026
| } CommandLineSettings; | ||
|
|
||
| static bool parseTreeStableMode(const char* arg, int* stableTreeView) { | ||
| if (String_eq(arg, "0") || String_eq(arg, "jumpy")) { |
Member
There was a problem hiding this comment.
Suggested change
| if (String_eq(arg, "0") || String_eq(arg, "jumpy")) { | |
| if (String_eq(arg, "0") || String_eq(arg, "jumpy") || String_eq(arg, "legacy")) { |
…h F on an already followed process
Member
Author
added 3 commits
May 3, 2026 17:57
0 - off (default) 1 - soft (tree will jump when the followed process needs to be moved up for visual reasons) 2 - hard (tree will be allowed to be starting mid-screen as the selected line is defended to be visually stable hard) Setting written to screen.stable_tree_view Assisted-by: Microsoft Copilot/Claude Sonnet 4.6
…ction * Also Alt-UP and Alt-DOWN as the Shift variants are often grabbed by the terminal emulators for scollback navigation
Member
Author
|
Partially squashed as per #1957 (comment) |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improvements to the following function are needed to make the stable tree view make sense (otherwise it would be quite just a duplication of functionality). Hence commit #1.
The stable tree view comes in two flavors:
soft = htop tries to keep the tree view stable but does not allow blank space above the tree root (PID 0) to accommodate all possible tree refreshs
hard = htop allows blank lines above the tree root (PID 0) to keep the visual line at nearly all cost
The default is off, so retain existing jumpiness.
I did not implement a hot key for switching as I think people who like stable tree view will just switch it on and keep it that way.
Fixes #1905