Commit 0964e69
Open "Default App" files in the running Warp channel (#9285)
## Description
Fixes #9189. When the user has multiple Warp channels installed (e.g.
Stable + Preview), LaunchServices may register the Stable build as the
default handler for common file types. The "Open File → Default App"
path then resolves to that sibling channel and hands files to Stable
even when the user is running Preview.
The bug sits at `app/src/util/file/external_editor/mac.rs:336`:
`default_app_to_open_path` returns the LaunchServices default,
`Editor::new_from_identifier` has no `dev.warp.*` variants so the result
is dropped, and we fall through to `ctx.open_file_path(full_path)` which
is `[NSWorkspace openURL:]`. NSWorkspace then routes via the same
default-app it just resolved, so the file lands in the other Warp.
The fix detects this case after the existing editor-resolution path: if
the system default is a Warp bundle other than the running channel's
bundle (`ChannelState::app_id()`), open the file with the running
channel's bundle directly via `/usr/bin/open -b`. Non-Warp defaults (VS
Code, TextEdit, etc.) are unaffected, and when the system default
already matches the running channel the override is skipped.
## Testing
Added 2 unit tests in `app/src/util/file/external_editor/mac.rs` for the
new `is_warp_bundle` helper:
- `dev.warp.{Warp,WarpDev,WarpPreview,WarpOss}` → matches
- `com.microsoft.VSCode`, `com.apple.TextEdit`, `dev.zed.Zed`,
`invalid`, empty → does not match
Both pass under `cargo test -p warp --lib
util::file::external_editor::mac::tests`.
The end-to-end behavior (file actually landing in the running channel)
requires a multi-channel macOS install to verify; I didn't manually
reproduce because the build I have access to is the OSS channel only.
Logic is small enough that a Warp dev with Stable + Preview side-by-side
should be able to confirm in seconds.
## Agent Mode
- [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
## Changelog Entries for Stable
CHANGELOG-BUG-FIX: `Open File → Default App` now opens files in the
running Warp channel instead of routing to a different installed Warp.
---------
Co-authored-by: Aloke Desai <aloke@warp.dev>1 parent 0fca61d commit 0964e69
2 files changed
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
347 | 363 | | |
348 | 364 | | |
349 | 365 | | |
350 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
351 | 383 | | |
352 | 384 | | |
353 | 385 | | |
| |||
368 | 400 | | |
369 | 401 | | |
370 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments