Closed klemensn closed 3 years ago
Thanks for the patch. I think DEFAULT_OPEN will fail if not quoted, isn't it?
You're right.
I've updated my commit to only avoid quoting for mailcap handled entries and hopefully clarify the issue a bit further in the commit message.
The readme.md example itself uses double-quotes but tg still shell-escapes/quotes filepaths.
Specifically, mailcap entries like video/*; mpv --quiet --loop=inf '%s'; test=test -n "$DISPLAY" would be passed quoted strings for `%s' and create bogus commands like mpv --quiet ''/path with space.mp4'' effectively breaking the quotes.
NB: This is only a best-effort approach, i.e. file paths are still shell-escaped in tg's Python code and then passed to NOTIFY_CMD et al. expecting them to be interpreted by the shell.
It would be best to either