fruitbasket
fruitbasket copied to clipboard
Launch bundle as subprocess instead of via Cocoa API
This replaces PR #30 by @Zyllian. It is exactly the same change, but without the auto formatting. I also added an example to demonstrate that stdin/stdout/stderr are captured by the parent process.
The main motivation for this change is to make cargo run ...
show the output of the running application, including logging and backtraces in the case of a panic.
I ran the examples to verify that launching via the Rust standard library subprocess command instead of the Cocoa API still causes the application to be treated as a bundle. With this change, the launch services still pick up the URL registration, and my own application which uses the menu bar works as well. AFAICT the only visible effect of this PR is that the parent (unbundled) process does not terminate until the child does, and the child process inherits the same stdin/stdout/stderr file handles.
This change also has the benefit of removing one unsafe{}
block in osx.rs
. The commits are split up: one makes the change, while the other removes the now unnecessary indentation (but otherwise doesn't change the code). A third commit adds the terminal.rs
example.
As with #30, I'm leaving this open and unmerged since I don't currently have a way to test it.
It's most unfortunate that both automated build/CI services I was using for these projects shutdown, so I don't even get validation that they compile correctly anymore. My endless to-do list includes setting up a mac build server... someday.
@maaku: you asked in the other thread if I need a maintainer, and I guess the answer is that I need a tester, at least. I'm not prepared to hand over merge permissions just yet, but I am willing to merge PRs if others assert that they are tested and working. Though, it would be good to define what "working" means...