Skip to content

Stop Warp auto-claiming common file types on macOS (LSHandlerRank=Alternate)#13121

Merged
zachbai merged 2 commits into
masterfrom
factory/plist-handler-rank-alternate
Jun 27, 2026
Merged

Stop Warp auto-claiming common file types on macOS (LSHandlerRank=Alternate)#13121
zachbai merged 2 commits into
masterfrom
factory/plist-handler-rank-alternate

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description

On macOS, Warp registers itself as a handler for a broad set of file types via the CFBundleDocumentTypes block written into the app's Info.plist by script/update_plist. Several of those entries omitted LSHandlerRank, so they registered at the default rank — which lets macOS LaunchServices auto-select Warp as the default handler for things like Markdown (.md), plain text, and source files, silently taking them over without the user ever choosing Warp.

This sets LSHandlerRank = Alternate on the six entries that previously omitted it:

  • Folder (public.folder)
  • Terminal shell script (com.apple.terminal.shell-script)
  • Unix Executable File (public.unix-executable)
  • Markdown File (net.daringfireball.markdown, public.markdown, …)
  • Plain Text File (public.plain-text)
  • Source Code File (public.source-code)

With Alternate rank, Warp still appears in the macOS "Open With" list for these types but is no longer auto-picked as the default handler. The two remaining entries (the source-code extension list and "All Documents") were already Alternate, so after this change every declared document type is Alternate.

This is the build-time/packaging portion of the fix discussed in the Slack thread. A separate, optional runtime opt-in (a setting that uses LaunchServices to make Warp the default for chosen categories) can be layered later for users who want Warp as their editor.

Linked Issue

Reported via Slack (no GitHub issue): see thread.

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below.

Testing

This is a macOS-only packaging/plist change in a shell script — there is no Rust code path, UI surface, or app-runtime behavior to exercise, and it cannot be meaningfully validated on this Linux runner (macOS LaunchServices is what consumes LSHandlerRank). Validation performed:

  • bash -n script/update_plist passes (script syntax).
  • Parsed the generated CFBundleDocumentTypes XML with plistlib and confirmed it is well-formed and that all 8 document-type entries now carry LSHandlerRank = Alternate.

A regression unit test, ./script/presubmit (Rust fmt/clippy/tests), and computer_use UI verification are not applicable to a macOS-only Info.plist packaging change and could not run on a Linux runner. A maintainer on macOS can confirm by bundling the app and checking that Warp no longer auto-becomes the default handler for .md/text/source files (it should still be available under "Open With").

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Set LSHandlerRank=Alternate on the CFBundleDocumentTypes entries in
script/update_plist that previously omitted it (Folder, Terminal shell
script, Unix Executable File, Markdown File, Plain Text File, and Source
Code File). With Alternate rank, Warp still appears in the macOS "Open
With" list for these types but is no longer auto-selected as the default
handler, so it stops silently taking over files like .md without the
user choosing it. The remaining entries (the source-code extension list
and "All Documents") were already Alternate.

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 27, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates the macOS Info.plist generation script so all declared document types use LSHandlerRank=Alternate, preventing Warp from being auto-selected as the default handler while keeping it available in Open With.

Concerns

  • The change affects user-visible macOS file-handler behavior, but the PR description does not include screenshots or a short recording demonstrating that Warp no longer becomes the default handler and still appears under Open With.

Verdict

Found: 0 critical, 0 important, 1 suggestion

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread script/update_plist
<dict>
<key>CFBundleTypeName</key><string>Folder</string>
<key>CFBundleTypeRole</key><string>Editor</string>
<key>LSHandlerRank</key><string>Alternate</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [SUGGESTION] For this user-facing macOS handler behavior change, please include screenshots or a short recording showing Warp is no longer the default handler and still appears under Open With.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I unfortunately can't produce macOS Finder screenshots/recordings here: this PR is generated by an automated agent running on a Linux cloud runner, and the behavior in question (LSHandlerRank / default-handler selection and the "Open With" list) is enforced by macOS LaunchServices, which does not exist on Linux.

This change is pure Info.plist metadata — no Rust/app code path. I validated it by (a) bash -n script/update_plist, and (b) parsing the generated CFBundleDocumentTypes XML with plistlib, confirming it is well-formed and that all 8 declared document types now carry LSHandlerRank=Alternate.

A maintainer on macOS can confirm end-to-end by bundling the app (script/bundle) and checking that Warp no longer auto-becomes the default handler for .md/text/source files while still appearing under "Open With".

@zachbai zachbai enabled auto-merge (squash) June 27, 2026 01:32
@zachbai zachbai disabled auto-merge June 27, 2026 01:43
Comment thread script/update_plist Outdated
<dict>
<key>CFBundleTypeName</key><string>Unix Executable File</string>
<key>CFBundleTypeRole</key><string>Shell</string>
<key>LSHandlerRank</key><string>Alternate</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<key>LSHandlerRank</key><string>Alternate</string>

As a terminal, we should claim "Unix Executable File"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed LSHandlerRank=Alternate from the Unix Executable File entry so Warp claims it at default rank again. (0701ae6)

Comment thread script/update_plist Outdated
<dict>
<key>CFBundleTypeName</key><string>Terminal shell script</string>
<key>CFBundleTypeRole</key><string>Shell</string>
<key>LSHandlerRank</key><string>Alternate</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<key>LSHandlerRank</key><string>Alternate</string>

As a terminal, we should claim "Terminal shell script"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed LSHandlerRank=Alternate from the Terminal shell script entry so Warp claims it at default rank again. (0701ae6)

Per review feedback (acarl005): Warp is a terminal, so it should remain
the default handler for Terminal shell scripts (com.apple.terminal.shell-script)
and Unix Executable Files (public.unix-executable). Remove the
LSHandlerRank=Alternate from those two CFBundleDocumentTypes entries so
they register at default rank again. The editor-style types (Folder,
Markdown, Plain Text, source code, All Documents) keep Alternate so Warp
no longer auto-claims those.

Co-Authored-By: Warp <agent@warp.dev>
@zachbai zachbai removed their request for review June 27, 2026 01:52
@zachbai zachbai merged commit bc9cd02 into master Jun 27, 2026
47 of 49 checks passed
@zachbai zachbai deleted the factory/plist-handler-rank-alternate branch June 27, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants