Skip to content
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

Add support for displaying process usernames on Windows #1016

Merged
merged 1 commit into from
Feb 10, 2023
Merged

Add support for displaying process usernames on Windows #1016

merged 1 commit into from
Feb 10, 2023

Conversation

mbikovitsky
Copy link
Contributor

@mbikovitsky mbikovitsky commented Feb 9, 2023

Description

This adds the "User" column to the process table on Windows. Usernames are extracted using the sysinfo library.

The main reason for adding this is that it allows filtering of the processes that belong to the current user.

Testing

Tested by visual inspection:

  • The name of the user running the application is correctly displayed.
  • When running un-elevated, the usernames of other processes are shown as "N/A".
  • When running elevated, the usernames for some of the other processes are displayed. This appears to be a limitation of how sysinfo gathers usernames.

image

Tested on:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 20.72% // Head: 20.73% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (9b82ad6) compared to base (e7b682a).
Patch coverage: 15.38% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1016      +/-   ##
==========================================
+ Coverage   20.72%   20.73%   +0.01%     
==========================================
  Files          75       75              
  Lines       14681    14683       +2     
==========================================
+ Hits         3042     3044       +2     
  Misses      11639    11639              
Impacted Files Coverage Δ
src/app/data_harvester.rs 0.00% <0.00%> (ø)
src/app/data_harvester/processes.rs 0.00% <ø> (ø)
src/app/query.rs 0.00% <0.00%> (ø)
src/widgets/process_table/proc_widget_column.rs 13.92% <0.00%> (ø)
src/widgets/process_table/proc_widget_data.rs 9.58% <0.00%> (+0.06%) ⬆️
src/widgets/process_table.rs 14.35% <100.00%> (+0.32%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@ClementTsang ClementTsang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. Thanks for adding this, I'll merge sometime soon unless I spot something else.

@ClementTsang ClementTsang merged commit d956f33 into ClementTsang:master Feb 10, 2023
@ClementTsang
Copy link
Owner

@all-contributors please add @mbikovitsky for code.

@allcontributors
Copy link
Contributor

@ClementTsang

I've put up a pull request to add @mbikovitsky! 🎉

@mbikovitsky mbikovitsky deleted the windows-usernames branch February 10, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants