Likely for historical reasons, macOS does not pass documents sent to application bundles as argv
. This repository is a simple demo of the lack of this feature1.
Simply, this repository:
- creates an macOS Application Bundle called
Toy.app
2 - writes anything passed to
argv
to/tmp/argv.txt
Using butonageo/cargo-bundle
macOS does not pass documents in argv
to app bundles when invoked; moreover cargo-bundle
does not have this functionality, either.
- enable
cargo-bundle
to automatically enable macOS bundles to receive documents usingargv
- petition Apple to offer a flag in
Info.plist
file to enable application bundles to receive documents, much as they do on traditional linux and other *nix systems
Why? today it is easier than ever to build cross-platform application bundles for Windows, Linux, and macOS. That said, macOS' current implementation places a large burden on developers. For example, there are 47 comments on this GitHub PR for the a GUI-harness for the neovim
text editor, which consitute dozens of developer hours spent on attempting to rectify this issue.
Related this issue in the cargo-bundle
codebase.
git clone git@github.com:abhillman/macos-argv.git
cargo build
Footnotes
-
Apple instead requires applications to use a bespoke message-passing implementation; see Wikipedia: Apple Events and Apple Developer Documentation: Apple Events ↩
-
Accomplished via simply adding relevant metadata to
Cargo.toml
and adding thecargo-bundle
crate ↩