julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.37k stars 330 forks source link

Exception when send some special characters #213

Closed kliner closed 7 years ago

kliner commented 7 years ago

Eg.: (), (.), (_), (._.)

Exception messages:

2017-04-16 15:54:40.942 terminal-notifier[13649:1704417] -[NSSingleObjectArrayI stringByTrimmingCharactersInSet:]: unrecognized selector sent to instance 0x7ff7f6502ce0 2017-04-16 15:54:40.942 terminal-notifier[13649:1704417] -[NSSingleObjectArrayI stringByTrimmingCharactersInSet:]: unrecognized selector sent to instance 0x7ff7f6502ce0

2017-04-16 15:55:03.134 terminal-notifier[13659:1704629] -[NSArray0 stringByTrimmingCharactersInSet:]: unrecognized selector sent to instance 0x7fba3ad032c0 2017-04-16 15:55:03.134 terminal-notifier[13659:1704629] -[NSArray0 stringByTrimmingCharactersInSet:]: unrecognized selector sent to instance 0x7fba3ad032c0

julienXX commented 7 years ago

@kliner you must escape special characters like terminal-notifier -message "\(\\)" or terminal-notifier -message "\(._.)"

kliner commented 7 years ago

Ty. Anything else needs to be escaped?

julienXX commented 7 years ago

You're welcome. I suppose everything that can be interpreted as part of a shell command should be escaped (ie. quotes, parens...).