From 0e14f251301e42961c1b98f27370179180c38fb4 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Thu, 15 Feb 2024 17:52:56 -0800 Subject: [PATCH] fix(scoop): detect shims correctly w/ sysinfo 0.30 This commit is a fix that handles a subtle breaking change in sysinfo::Process:root() which no longer can be used to see if a process is a scoop shim. Instead we can stringify the executable path and see if the absolute exe path contains the substring "shims". With this fix duplicate process detection is once again working correctly. --- komorebi/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/komorebi/src/main.rs b/komorebi/src/main.rs index e4d55a4e..db1eae81 100644 --- a/komorebi/src/main.rs +++ b/komorebi/src/main.rs @@ -482,8 +482,8 @@ fn main() -> Result<()> { if matched_procs.len() > 1 { let mut len = matched_procs.len(); for proc in matched_procs { - if let Some(root) = proc.root() { - if root.ends_with("shims") { + if let Some(executable_path) = proc.exe() { + if executable_path.to_string_lossy().contains("shims") { len -= 1; } }