Skip to content

Commit

Permalink
fix(scoop): detect shims correctly w/ sysinfo 0.30
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LGUG2Z committed Feb 16, 2024
1 parent 380971e commit 0e14f25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions komorebi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0e14f25

Please sign in to comment.