Skip to content

Conversation

@mxvsh
Copy link

@mxvsh mxvsh commented Nov 18, 2025

Summary

This PR adds support for copying and pasting files/folders across different Zed windows using the system clipboard.

Previously, the paste button was disabled when trying to paste files copied from another Zed window. This implementation enables:

  • Cross-window clipboard: Copy files in one Zed window and paste them in another
  • Cross-instance support: Works between different Zed instances
  • External file integration: Can paste file paths copied from system file managers (Finder/Explorer)
  • Cut/Copy distinction: Preserves whether files were cut or copied

Implementation

  • Modified copy() and cut() to write file paths to system clipboard with format: ZED_CLIPBOARD:CUT|COPY\n/path1\n/path2...
  • Added has_clipboard_content() to check both local and system clipboard
  • Added parse_system_clipboard() to parse Zed format or external file paths
  • Updated paste() to check local clipboard first, then fall back to system clipboard
  • Added write_entries_to_system_clipboard() helper function

Test Plan

  1. Open two Zed windows
  2. Copy files/folders in window A (Cmd+C / Ctrl+C)
  3. Switch to window B
  4. Right-click in project panel → Paste option should now be enabled
  5. Paste successfully copies the files to the target location

Release Notes:

  • Added cross-window file/folder copy-paste support in project panel via system
    clipboard

🤖 Generated with Claude Code

@cla-bot
Copy link

cla-bot bot commented Nov 18, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @mxvsh on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mxvsh mxvsh force-pushed the feat/cross-window-file-clipboard branch from fe92848 to a19491b Compare November 18, 2025 05:52
@cla-bot
Copy link

cla-bot bot commented Nov 18, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @mxvsh on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@mxvsh
Copy link
Author

mxvsh commented Nov 18, 2025

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 18, 2025
@cla-bot
Copy link

cla-bot bot commented Nov 18, 2025

The cla-bot has been summoned, and re-checked this pull request!

Copy link

@spandan-kumar spandan-kumar left a comment

Choose a reason for hiding this comment

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

looks clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants