Files
zed/crates
koh-shandConrad Irwin 5be9dc1781 Fix duplicate window when opening from CLI on macOS (#48146)
Closes #47140
Closes #44691

When launching Zed from the CLI (`zed .`), macOS delivers the path as a
`kAEGetURL` Apple Event via Launch Services. Zed relied on the
`application:openURLs:` delegate method to receive this, but its timing
relative to `applicationDidFinishLaunching:` is not guaranteed by macOS.
In release builds, the app reaches `didFinishLaunching` before the URL
is delivered, causing it to be missed and a duplicate window to be
opened. This does not reproduce in debug builds due to slower
initialization, which is why the issue was hard to reproduce from
source.

This replaces `application:openURLs:` with a custom `kAEGetURL` Apple
Event handler registered in `applicationWillFinishLaunching:`. Apple
Events are guaranteed to be delivered synchronously between
`willFinishLaunching` and `didFinishLaunching`, ensuring the URL is
always available before startup logic runs.

 Release Notes:

- Fixed duplicate window creation when opening files/directories from
the CLI on macOS.

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-04-08 23:14:54 -06:00
..
2026-04-05 23:05:35 +01:00
2026-03-27 14:56:46 -07:00
2026-03-11 03:08:39 +00:00
2026-03-30 09:06:59 +00:00
2026-02-26 18:36:50 +01:00
2026-03-30 09:06:59 +00:00
2026-04-08 17:54:51 +00:00