What --- Fix pasting image files copied from Finder in the Agent Panel on macOS. Previously, pasting an image file copied with `Cmd+C` in Finder would insert the file path as plain text instead of attaching the image as context. Why --- Two bugs combined to cause this: 1. **Wrong clipboard type priority in `pasteboard.rs` (fixed in #49367):** ~~The macOS pasteboard reader checked `public.utf8-plain-text` first. When Finder copies a file it places the filename as a string, the file path in `NSFilenamesPboardType`, and a TIFF of the file icon — all in the same clipboard event. Because strings were checked first, Zed read the filename string and ignored the image data entirely.~~ 2. **Missing `cx.stop_propagation()` in `message_editor.rs`:** The `paste()` handler is registered as a `capture_action`. In GPUI's capture phase, `propagate_event` defaults to `true` — simply `return`ing does not stop propagation. Without an explicit `cx.stop_propagation()`, the inner `Editor`'s bubble-phase paste handler also fired, read `ExternalPaths` from the clipboard, converted it to text via `ClipboardItem::text()` (which returns the file path string), and inserted it alongside the image. Fix --- gpui_macos/src/pasteboard.rs`: Change clipboard read priority to **file paths → image data → string**. Added `read_external_paths()` which reads `NSFilenamesPboardType` and returns a `ClipboardEntry::ExternalPaths`. This lets the existing `paste_images_as_context` path load the actual file content. - `agent_ui/src/message_editor.rs`: Add `cx.stop_propagation()` before `task.detach()` when the image paste task is accepted, preventing the inner editor from also handling the event. Closes #51574 Test Plan --- - [x] `cargo fmt --all -- --check` - [x] `cargo build -p gpui_macos agent_ui` compiles clean - [x] Manual verification of: - [x] Copy an image file in Finder (`Cmd+C`), paste into Agent Panel — image attaches correctly - [x] Copy image from browser ("Copy Image"), paste into Agent Panel — image attaches correctly - [x] `Cmd+Shift+4` screenshot paste still works - [x] Regular text paste still works Release Notes - Fixed pasting image files copied from Finder inserting the file path instead of attaching the image in the Agent Panel Screenshots --- https://github.com/user-attachments/assets/edf6ba5a-6ff7-478c-a9ed-7cb5e889ccb3 <img width="801" height="388" alt="image" src="https://github.com/user-attachments/assets/32d9321b-b0f6-47ae-a6b3-ea343cb69757" />
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.