Repository navigation
fix(macos): parse lsappinfo report output - #144
Merged
Merged
Conversation
Unmatched sed output was accepted as an app name, skipping the System Events fallback and preventing focus suppression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
suppressWhenFocused: true, notifications were still delivered while OpenCode was focused in a Ghostty/tmux popup on macOS 27.0.1 (build 26A434). This was reproduced with notifier 0.6.1; the same parser is present on the current main branch.Run
lsappinfo info -only name "$(lsappinfo front)"while Ghostty is frontmost. The exact output observed was:The same report format was also observed when querying Finder. This establishes the reproduction, but does not establish why this macOS installation returns a report instead of the requested name=value field.
The current sed substitution leaves unmatched lines unchanged. The resulting report is nonempty, so the plugin accepts it as the app name and skips its System Events fallback. Comparing the report with the expected terminal name then reports the terminal as unfocused.
Change
Parse the raw output in TypeScript, supporting both name=value fields and the quoted application name in the report header. Reject empty, malformed, or unrecognized output so the existing System Events fallback can run. Add focused regression tests, a README clarification, and an Unreleased changelog entry.
OpenCode version and platforms
Evidence
git diff --checkpassed.bun test src/focus.test.tspassed (65 tests, 107 assertions);bun run typecheckpassed. Dependencies were installed withbun install --frozen-lockfile.Model:
openai/gpt-6.1-sol. Harness: OpenCode.