Skip to content

fix: replace substring matching with exact process name matching#44

Open
Jah-yee wants to merge 1 commit into
Kanwaljeet1:mainfrom
Jah-yee:fix/exact-process-name-matching
Open

fix: replace substring matching with exact process name matching#44
Jah-yee wants to merge 1 commit into
Kanwaljeet1:mainfrom
Jah-yee:fix/exact-process-name-matching

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Jun 3, 2026

Description

Replace .contains() with eq_ignore_ascii_case() for blacklist/whitelist matching in focus_mode.rs.

Problem: Substring matching causes unintended processes to be suspended. For example, blacklist entry 'drive' matches 'GoogleDriveFS.exe', 'OneDrive.exe', etc.

Solution: Use exact case-insensitive matching instead.

Changes

  • name.contains(&b.to_lowercase())name.eq_ignore_ascii_case(b)
  • Same change for whitelist matching

Testing

  • Existing tests pass
  • Behavior change: only exact process name matches are affected

Fixes #40

Replace .contains() with eq_ignore_ascii_case() in focus_mode.rs
blacklist/whitelist matching. This prevents unintended processes
from being suspended when their names merely contain a blacklisted
substring (e.g., 'drive' matching 'GoogleDriveFS.exe').

Before: name.contains(&b.to_lowercase()) — substring match
After:  name.eq_ignore_ascii_case(b) — exact match (case-insensitive)

Fixes issue Kanwaljeet1#40.

Signed-off-by: Jah-yee <jydu_seven@outlook.com>
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.

Bug: Focus Mode may suspend unintended processes due to substring-based process matching

1 participant