zed
zed copied to clipboard
Agent Panel: Copying Agent responses to clipboard results in duplicate or incomplete text
Summary
Description
When copying agent responses from the Agent Panel (text thread), the clipboard content is duplicated and/or truncated
Steps to Reproduce
Scenario 1:
- Start a new text thread.
- Ask the agent a question. Let it generate single line answer.
- Use the
editor: copycommand to copy the agent’s full response. - Paste the content elsewhere.
Result: The pasted text appears twice (duplicated).
Scenario 2:
- Start a new text thread.
- Ask the agent a question that results in a multi-line answer.
- Use the
editor: copycommand to copy the full response. - Paste the content elsewhere.
Result: Only the first line is copied and pasted, and it appears twice.
Scenario 3:
- Start a new text thread.
- Ask the agent a question that results in a multi-line answer.
- Copy a few lines of the agent’s answer, excluding the first line, using the
editor: copycommand. - Paste the content elsewhere.
Result: The pasted text appears as expected (no issues).
Actual Behavior:
- When copying the entire single-line response, the pasted text is duplicated (concatenated with itself).
- When selecting and copying the whole multi-line response, only first line is pasted (and appears twice); the rest of the content is missing.
- Copying lines other than the first one (i.e., not including the first line in the selection) works as expected.
Expected Behavior:
- The selected text should be copied exactly as it appears, without duplication or truncation.
Note: I've observed that this issue seems to occur during the copy operation itself, as using the editor: copy and trim command produces the correct behaviour.
Zed Version and System Specs
Zed: v0.188.0 (Zed Preview) OS: macOS 15.5.0 Memory: 24 GiB Architecture: aarch64
Thank you for reporting. I can reproduce all the scenarios mentioned in the issue.