Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notify-send backend fails when user string starts with "-" #396

Open
JGCarroll opened this issue Feb 5, 2022 · 0 comments
Open

notify-send backend fails when user string starts with "-" #396

JGCarroll opened this issue Feb 5, 2022 · 0 comments

Comments

@JGCarroll
Copy link

Related discussion: laurent22/joplin#6029

Node-Notifier creates notify-send commands with the logical syntax of
notify-send $PARAMS $INPUT

In the event the string for the title/body in $INPUT begins with -, notify-send aborts the command because it interprets the string as a parameter it can't recognise. The fix for this is to create a clear separation between parameters and input, by appending -- between the two, so that parameter handling is disabled on the raw input.
notify-send $PARAMS -- $INPUT

As a concrete example from the linked issue:
notify-send --icon "/snap/joplin-desktop/23/opt/joplin-desktop/resources/build/icons/512x512.png" --expire-time "10000" "To do" "- [ ] plans for today"

fails, whereas

notify-send --icon "/snap/joplin-desktop/23/opt/joplin-desktop/resources/build/icons/512x512.png" --expire-time "10000" -- "To do" "- [ ] plans for today"

works just fine. It'd be ideal if notify-send would include this by default to prevent this from occuring.

Thanks in advance for any assistance you can offer :)

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

No branches or pull requests

1 participant