Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow atom:// urls to be opened from the command line #15683
I would love some guidance on how to write an automated test for this.
Description of the Change
Some Atom extensions (like Nuclide) have functionality that can only be
This change doesn't set Atom up as the default handler for atom:// urls.
I considered making a separate option for passing urls (--open-url), but this seems more convenient.
Why Should This Be In Core?
Very simple change. Brings the "open-url" interface to all platforms.
Windows and Linux users can easily simulate "open-url" events.
Can't use the atom command line to open a file whose name starts with
Thanks for the PR! Phew, it's been a really long time since I was in Atom's main process code, but here are some thoughts:
First, are you doing something special with
Second, there have been some security concerns raised from our internal appsec team around parsing URLs passed to Atom — but perhaps it's only a problem when Atom can be launched from the browser (e.g. when it's registered as a protocol handler).
That said, if this already works on macOS, I can't see why we wouldn't bring this into parity on other platforms. Pinging @atom/feedback in hopes that someone with more experience in the main process than I chimes in
Yes. I don't know exactly how it works, but on Mac clicking an atom:// link can tell Nuclide to open a specific file (in a repository-aware way) or trigger interactions with other tools. (Like, I get an email with a link, and I can click it to auto-clone my co-worker's work-in-progress code.)
Yep. I think that's compatible with what Nuclide is doing now, though Hanson would know better. This PR should be orthogonal to that change. It just allows non-Mac users to send these URLs to Atom, regardless of how they will be dispatched once they get there.
On my desktop environment (MATE with Firefox and Chrome), opening one of these links from the browser requires a confirmation. If there are more specific concerns, though, I'm happy to address them.
@BinaryMuse we ended up implementing a really scrappy
Would love to be able to use #11399! I think one thing to note with the proposed API is that it may send the URL message before all packages have loaded, so URLs opening in new windows may not be handle-able by user packages (unless I misunderstood something).