-
-
Notifications
You must be signed in to change notification settings - Fork 546
Implement filtering by process state (#1544) #1755
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
Conversation
BenBE
left a comment
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.
Why limit this to one state artificially when you are storing a pointer to a string anyway?
The changes of this PR could have been one commit. Please rebase to squash them into one commit.
Also, please write all comments, including commit messages, in English.
Process.c
Outdated
| char stateChar = processStateChar(this->state); | ||
| if (stateChar != stateFilter[0]) { | ||
| return true; | ||
| } | ||
| } |
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.
Indentation
CommandLine.c
Outdated
| if (flags.stateFilter) { | ||
| free_and_xStrdup(&settings->stateFilter, flags.stateFilter); | ||
| } |
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.
Indentation
CommandLine.c
Outdated
| break; | ||
| case 'S': | ||
| assert(optarg); | ||
| if (optarg[0] == '\0' || optarg[1] != '\0' || !strchr("URQWDBPTtZXIS", optarg[0])) { |
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.
The list of valid state characters depends on the platform.
Settings.h
Outdated
| bool topologyAffinity; | ||
| #endif | ||
|
|
||
| char* stateFilter; |
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 thought the Settings structure is a wrong place for stateFilter. The Settings object is for things that would be saved and loaded in htoprc file, and the filters shouldn't carry across restarts of htop.
|
Somehow indentation in this PR has gotten even worse … |
|
I start to suspect @melrovieira is using an LLM to implement this feature, without full understanding how to code. The commit description of f6d6037 is not helpful. It's useless to give a line-by-line description of changes, as the patch/diff itself can convey the same information. |
|
@Explorer09 Brother, I'm not using LLM, it's just that I've never documented any code, this is my first PR and I don't speak English. But forgive me if I made it seem that way. I tested everything and it's working. I documented poorly because I really don't know how to do it. I'm even using a translator right now. |
|
If you can help me, I appreciate it |
Forgive me for this, I just used the resource that was in the code style guide. |
|
Due to a mishap continued in #1757 … |
PR_HTOP.mp4