Repository navigation
Action: verify the selected row is a Process before casting #2151
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
Open
pwilke
wants to merge
2
commits into
htop-dev:main
Choose a base branch
from
pwilke:guard-process-cast
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: htop-dev/htop
Length of output: 12061
Script executed:
Repository: htop-dev/htop
Length of output: 14407
Script executed:
Repository: htop-dev/htop
Length of output: 23767
Script executed:
Repository: htop-dev/htop
Length of output: 3891
Script executed:
Repository: htop-dev/htop
Length of output: 33379
Script executed:
Repository: htop-dev/htop
Length of output: 30591
Do not transfer follow IDs between unrelated tables on Setup exit.
If Setup selects a different table,
setActiveScreencan copy a follow ID from the previous table. A PCP instance with ID 1 can then cause the process table to follow PID 1. Preserve each table’s follow state without transferring IDs across tables.Script executed:
Repository: htop-dev/htop
Length of output: 222
Script executed:
Repository: htop-dev/htop
Length of output: 19867
Script executed:
Repository: htop-dev/htop
Length of output: 28821
Script executed:
Repository: htop-dev/htop
Length of output: 31120
Add a regression test for Setup table synchronization.
If a screen backed by a different table is reordered in Setup, removing this call can leave
settings->ssandhost->activeTableout of sync. Add a test that reorders screens backed by different tables and checks the resulting pairing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see two ways out of this, tell me what you prefer.
setActiveScreenfunction here, without the follow ID transferswould replace the current
setActiveScreencall.setActiveScreeninto another function, saysetActiveScreenNoFollow, can call this latter function inAction_runSetupWhich version do you prefer? Or a third one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analysis chain
Script executed:
Length of output: 25374
@pwilkeI prefer the second option. It keeps screen and function-bar synchronization in one place and avoids transferring a follow ID on Setup exit. It also explicitly setssettings->ssfromsettings->screens[ssIdx].The wrapper preserves the existing behavior for normal tab changes. Those changes can still transfer follow IDs between different tables, so this proposal addresses Setup exit only.
After the change, please verify the Setup reproduction with process and PCP screens, including that Setup does not copy the previous table’s follow ID to the newly active table.
You are interacting with an AI system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this new version of
setActiveScreenIt adds a flag saying whether follow should be transferred. There are 3 existing calls to patch with an extra
trueparameter, and our new call inAction_runSetupthat would callsetActiveScreenwithtransferFollowset tofalse.I think this is better, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analysis chain
Script executed:
Length of output: 23097
@pwilkeYes, I prefer this version. It keeps screen synchronization in one function and makes follow-ID transfer explicit.Pass
falseon Setup exit andtrueat the three existing screen-switch calls. Also update the forward declaration. I would adjust the comment: transfers are skipped on Setup exit, but normal screen switches can still transfer IDs between unrelated tables.After the change, please verify the Setup reproduction with process and PCP screens. Check that the destination table keeps its own follow state and does not receive the previous table’s ID.
You are interacting with an AI system.