Fix sound setting ignored in send_macos_notification#25
Merged
mylee04 merged 1 commit intomylee04:mainfrom Mar 5, 2026
Merged
Conversation
terminal-notifier always plays a sound when -sound is passed, so cn sound off had no effect. Gate the -sound arg on should_play_sound, same as the existing play_sound call. Apply the same fix to the osascript fallback path.
Owner
|
@daturkel thank you so much, your finding and change will be really helpful for other users!! |
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
cn sound offhas no effect on macOS. Thesend_macos_notificationfunction always passes-sound "$SOUND"toterminal-notifier, which unconditionally plays a sound. The existingshould_play_soundcheck only gated a separateplay_soundcall, not the sound embedded in the notification itself.The same issue exists in the
osascriptfallback path.Fix
Gate the
-soundargument onshould_play_sound()for bothterminal-notifierandosascriptpaths, matching the pattern already used for the standaloneplay_soundcall.Testing
cn sound offthen trigger a notification → silent ✅cn sound onthen trigger a notification → plays sound ✅