{"record":{"id":"5e46a37b0a579aa5","repo":"Homebrew/homebrew-cask","slug":"unable-to-forcibly-close-blurscreen-app","errorCode":null,"errorMessage":"Unable to forcibly close BlurScreen.app","messagePattern":"Unable to forcibly close BlurScreen\\.app","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"Casks/b/blurscreen.rb","lineNumber":33,"sourceCode":"  auto_updates true\n  depends_on :macos\n\n  pkg \"BlurScreen-v2.pkg\"\n\n  postflight_steps do\n    # Description: Ensure console variant of postinstall is non-interactive.\n    # This is because `open \"$APP_PATH\"&` is called from the postinstall\n    # script of the package and we don't want any user intervention there.\n    terminate_process(\n      \"/Applications/BlurScreen.app\",\n      match:           :full,\n      attempts:        3,\n      must_succeed:    false,\n      notices:         [\n        \"The BlurScreen package postinstall script launches the BlurScreen app\",\n        \"Attempting to close BlurScreen.app to avoid unwanted user intervention\",\n      ],\n      failure_message: \"Unable to forcibly close BlurScreen.app\",\n    )\n  end\n\n  uninstall quit:    \"com.sanskar.blurscreen\",\n            pkgutil: \"com.sanskar.blurscreen\",\n            delete:  \"/Applications/BlurScreen.app\"\n\n  zap trash: [\n    \"~/Library/Caches/com.sanskar.blurscreen\",\n    \"~/Library/HTTPStorages/com.sanskar.blurscreen\",\n    \"~/Library/Preferences/com.sanskar.blurscreen.plist\",\n  ]\nend\n","sourceCodeStart":15,"sourceCodeEnd":47,"githubUrl":"https://github.com/Homebrew/homebrew-cask/blob/8587086220f4568daf43b90d1a0baf391e930c9e/Casks/b/blurscreen.rb#L15-L47","documentation":"Printed by the terminate_process step in blurscreen's postflight_steps (Casks/b/blurscreen.rb:33). The BlurScreen .pkg postinstall script runs `open \"$APP_PATH\"&` and auto-launches BlurScreen.app, so Homebrew follows up with `/usr/bin/pkill -f /Applications/BlurScreen.app`, up to `attempts: 3` times with 1-second sleeps. pkill returns non-zero when no process's full command line matches that path or when the signal cannot be delivered; after the final failed attempt Homebrew prints this failure_message as a `Warning:`. With `must_succeed: false` the step is advisory — the cask install always continues.","triggerScenarios":"`brew install|upgrade|reinstall --cask blurscreen` where the BlurScreen process never appears within the retry window: postinstall's `open` failed (no GUI session, e.g. SSH), the app launched after the third pkill attempt, a running copy lives at a different path (~/Applications or a renamed bundle), or pkill could not signal the process. Each failed attempt raises ErrorDuringExecution internally; after attempts hit zero the warning is printed.","commonSituations":"Automated/CI installs without a logged-in desktop user; the app is quit by the user faster than the retry loop samples it; vendor renames the bundle in a pkg update; an older manual install of BlurScreen running from another location.","solutions":["Treat the warning as informational when brew completed — `must_succeed: false` by design; afterwards quit any leftover app with `pkill -f /Applications/BlurScreen.app`.","Quit BlurScreen before the operation (`osascript -e 'quit app \"BlurScreen\"'`), then re-run `brew reinstall --cask blurscreen`.","Verify install state with `brew list --cask --versions blurscreen` rather than re-running.","If the app is running under a different path (`pgrep -fl BlurScreen`), update the literal path in the cask (`brew edit --cask blurscreen`) and submit a PR."],"exampleFix":"# before\nbrew upgrade --cask blurscreen\n# Warning: Unable to forcibly close BlurScreen.app\n\n# after: quit the screen-dimmer app first, then upgrade\nosascript -e 'quit app \"BlurScreen\"' || pkill -f '/Applications/BlurScreen.app'\nbrew upgrade --cask blurscreen","handlingStrategy":"validation","validationCode":"# Before brew install/upgrade --cask blurscreen, make sure BlurScreen is not running:\nosascript -e 'quit app \"BlurScreen\"' 2>/dev/null || pkill -f '/Applications/BlurScreen.app' 2>/dev/null || true\nbrew reinstall --cask blurscreen","typeGuard":null,"tryCatchPattern":"begin\n  Homebrew::SystemCommand.run!(\"/usr/bin/pkill\", args: [\"-f\", \"/Applications/BlurScreen.app\"])\nrescue ErrorDuringExecution\n  # No command line matched the path: app not running. Non-fatal by design.\n  warn \"Unable to forcibly close BlurScreen.app\"\nend","preventionTips":["Quit BlurScreen before brew operations on the cask.","Treat the warning as advisory (must_succeed: false); verify with `brew list --cask blurscreen` instead of re-running.","If you maintain the cask, re-verify the literal path against the bundle the pkg actually installs after each vendor release.","On headless/CI macs expect this warning whenever the GUI app cannot launch; gate follow-up steps on brew's exit code, not on the warning."],"tags":["homebrew","cask","macos","blurscreen","pkill","process-termination","postflight"],"backgroundTag":"pkill-no-process-matched","analyzedSha":"8587086220f4568daf43b90d1a0baf391e930c9e","analyzedAt":"2026-08-21T15:13:24.144Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}