-
Notifications
You must be signed in to change notification settings - Fork 6
Description
While this is not a direct issue with this repo itself, I think documenting this and being searchable here might help people to figure out what to do with this mysterious behaviour.
So things like below similar to the one from current README.md worked with open but not with Chrome for me.
on open location this_URL
do shell script "emacsclient \"" & this_URL & "\" && open -a Emacs"
end open locationAnd if you debug this by something like below. You don't really see the difference yet.
on open location this_URL
do shell script "echo '" & this_URL & "' >> ~/tmp/debug-org-protocol"
end open locationBut if you pipe it via base64 you might see a strange difference especially with a long enough this_URL
Try org-protocol://find-file:///Users/my-user/my-folder/my-file with both open and Chrome.
# tail -f ~/tmp/debug-org-protocol
# with `open` - it results in 2 lines - I don't know why
b3JnLXByb3RvY29sOi8vZmluZC1maWxlOi8vL1VzZXJzL215LXVzZXIvbXktZm9sZGVyL215LWZp
bGUK
# with Chrome - it prints in one line - expected
b3JnLXByb3RvY29sOi8vZmluZC1maWxlOi8vL1VzZXJzL215LXVzZXIvbXktZm9sZGVyL215LWZpbGUKHowever, if you wrap the whole script with zsh now the Chrome's behaviour follows the same as zsh and
on open location this_URL
do shell script "zsh -c \"echo '" & this_URL & "' | base64 >> ~/tmp/debug-org-protocol\""
end open location# with `open` - it stays the same
b3JnLXByb3RvY29sOi8vZmluZC1maWxlOi8vL1VzZXJzL215LXVzZXIvbXktZm9sZGVyL215LWZp
bGUK
# with Chrome - it follows `open` now
b3JnLXByb3RvY29sOi8vZmluZC1maWxlOi8vL1VzZXJzL215LXVzZXIvbXktZm9sZGVyL215LWZp
bGUKSame goes for org-protocol and now it is being recognized with Chrome as well with a code like below.
on open location this_URL
do shell script "zsh -c 'emacsclient \"" & this_URL & "\" && open -a Emacs'"
end open locationAlso, if I used bash instead of zsh, it didn't work.
Hope this is helpful for some people!