Repository navigation
Commit d6f1e4e
committed
fix(macos): attach to a running app instead of launching a duplicate on open
A macOS app started directly — by a supervisor or a dev script — is not
listed by LaunchServices until half a second or so after it spawns. During
that window `open -b` sees no instance and starts a second copy with no
arguments, which the session then drives instead of the copy the caller
owns (#3406).
The bundle open now reads the same view `open -b` consults and, when it
lists nothing while a process of that bundle is running, waits until
LaunchServices names the running copy before running `open` unchanged. An
already-listed bundle and a bundle with nothing running reach `open` on the
first read; the wait, every read, and the process scan share one budget, and
anything the probe cannot answer fails open so an open is never withheld.1 parent 5007540 commit d6f1e4e
6 files changed
Lines changed: 845 additions & 0 deletions
File tree
- packages/platform-apple/src
- core/__tests__
- os/macos
- website/docs/docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
0 commit comments