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

Process widget fails to show full commands on Windows #1538

Closed
1 task done
gschaffner opened this issue Aug 5, 2024 · 2 comments · Fixed by #1541
Closed
1 task done

Process widget fails to show full commands on Windows #1538

gschaffner opened this issue Aug 5, 2024 · 2 comments · Fixed by #1541
Labels
bug Something isn't working the way that is expected.

Comments

@gschaffner
Copy link

Checklist

What operating system and version are you using?

Windows 10 22H2

What architecture are you using?

x86_64/AMD64

What terminal(s) are you running bottom on that are experiencing the problem?

Konsole 24.05.2 (ssh from Arch Linux)

What filesystem(s) are you using?

NTFS

What version of bottom are you running?

0.10.1

How did you install bottom?

cargo install --locked, Rust 1.80.0.

Describe the issue

The full command (P) toggle for the process widget does not work on Windows.

What is the expected behaviour?

P toggles showing the full command.

What is the actual behaviour?

Toggling P still displays the name; the full command is not displayed.

How can we reproduce this?

  1. Run btm (no config required to repro.).
  2. Open the process widget and press P.
  3. Observe that the only change is "Name(n)" -> "Command(n)" in the table header, but no entries below in that column change.

Additional information

This is a regression in 0.10.0, Windows-only. Bisects to sysinfo 0.30 (via f07994e).

Setting the Process::cmd UpdateKind appears to fix it:

diff --git a/src/data_collection.rs b/src/data_collection.rs
index d37931f..3341bf5 100644
--- a/src/data_collection.rs
+++ b/src/data_collection.rs
@@ -15,6 +15,7 @@ pub mod processes;
 pub mod temperature;
 
 use std::time::{Duration, Instant};
+use sysinfo::{ProcessRefreshKind, UpdateKind};
 
 #[cfg(any(target_os = "linux", feature = "gpu"))]
 use hashbrown::HashMap;
@@ -284,7 +285,14 @@ impl DataCollector {
         #[cfg(not(target_os = "linux"))]
         {
             if self.widgets_to_harvest.use_proc {
-                self.sys.system.refresh_processes();
+                self.sys.system.refresh_processes_specifics(
+                    ProcessRefreshKind::new()
+                        .with_memory()
+                        .with_cpu()
+                        .with_disk_usage()
+                        .with_exe(UpdateKind::OnlyIfNotSet)
+                        .with_cmd(UpdateKind::OnlyIfNotSet),
+                );
 
                 // For Windows, sysinfo also handles the users list.
                 #[cfg(target_os = "windows")]

There might be other ProcessRefreshKind calls missing above; maybe ProcessRefreshKind::everything() would be better? It's also possible that bottom is missing some UpdateKinds for other things too.

@gschaffner gschaffner added the bug Something isn't working the way that is expected. label Aug 5, 2024
@gschaffner
Copy link
Author

gschaffner commented Aug 5, 2024

Ah, the user column is all "N/A" as well, so Process::user at least also needs a non-Never UpdateKind.

@ClementTsang
Copy link
Owner

ClementTsang commented Aug 5, 2024

👀 noted, will fix and probably put out a patch release in the next day or two for this. Thanks for reporting and tracking down the regression!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way that is expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants