From 082638cb14d5e8e12db72dc75cba54978236f6ff Mon Sep 17 00:00:00 2001 From: ClementTsang <34804052+ClementTsang@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:49:48 -0400 Subject: [PATCH 1/3] bug: fix not updating sysinfo processes correctly --- src/data_collection.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/data_collection.rs b/src/data_collection.rs index d37931f9d..a7ffd890a 100644 --- a/src/data_collection.rs +++ b/src/data_collection.rs @@ -123,6 +123,7 @@ pub struct SysinfoSource { impl Default for SysinfoSource { fn default() -> Self { use sysinfo::*; + Self { system: System::new_with_specifics(RefreshKind::new()), network: Networks::new(), @@ -284,7 +285,12 @@ 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( + sysinfo::ProcessRefreshKind::everything() + .without_environ() + .without_cwd() + .without_root(), + ); // For Windows, sysinfo also handles the users list. #[cfg(target_os = "windows")] From 5725e38382448026785618a750f8ac93aa5b9bec Mon Sep 17 00:00:00 2001 From: ClementTsang <34804052+ClementTsang@users.noreply.github.com> Date: Mon, 5 Aug 2024 18:08:56 -0400 Subject: [PATCH 2/3] also fix a potential panic spot on slow computers --- src/data_collection.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data_collection.rs b/src/data_collection.rs index a7ffd890a..a95b54ba4 100644 --- a/src/data_collection.rs +++ b/src/data_collection.rs @@ -174,6 +174,10 @@ pub struct DataCollector { impl DataCollector { pub fn new(filters: DataFilters) -> Self { + // Initialize it to the past to force it to load on initialization. + let now = Instant::now(); + let last_collection_time = now.checked_sub(Duration::from_secs(600)).unwrap_or(now); + DataCollector { data: Data::default(), sys: SysinfoSource::default(), @@ -186,7 +190,7 @@ impl DataCollector { temperature_type: TemperatureType::Celsius, use_current_cpu_total: false, unnormalized_cpu: false, - last_collection_time: Instant::now() - Duration::from_secs(600), /* Initialize it to the past to force it to load on initialization. */ + last_collection_time, total_rx: 0, total_tx: 0, show_average_cpu: false, From 79f6a41468ef59bc1cfb1f7f0881c7a9510abfce Mon Sep 17 00:00:00 2001 From: ClementTsang <34804052+ClementTsang@users.noreply.github.com> Date: Mon, 5 Aug 2024 18:15:57 -0400 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index def83c741..2f48e74a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1487](https://github.com/ClementTsang/bottom/pull/1487): Add option to move the AVG CPU bar to another row in basic mode. +### Bug Fixes + +- [#1541](https://github.com/ClementTsang/bottom/pull/1541): Fix some process details not updating for macOS and Windows. + ## [0.10.1] - 2024-08-01 ### Bug Fixes