zed icon indicating copy to clipboard operation
zed copied to clipboard

Agent Panel: Copying Agent responses to clipboard results in duplicate or incomplete text

Open xab3r opened this issue 6 months ago • 1 comments

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:

  1. Start a new text thread.
  2. Ask the agent a question. Let it generate single line answer.
  3. Use the editor: copy command to copy the agent’s full response.
  4. Paste the content elsewhere.

Result: The pasted text appears twice (duplicated).

Scenario 2:

  1. Start a new text thread.
  2. Ask the agent a question that results in a multi-line answer.
  3. Use the editor: copy command to copy the full response.
  4. Paste the content elsewhere.

Result: Only the first line is copied and pasted, and it appears twice.

Scenario 3:

  1. Start a new text thread.
  2. Ask the agent a question that results in a multi-line answer.
  3. Copy a few lines of the agent’s answer, excluding the first line, using the editor: copy command.
  4. 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

xab3r avatar May 22 '25 08:05 xab3r

Thank you for reporting. I can reproduce all the scenarios mentioned in the issue.

smitbarmase avatar May 28 '25 15:05 smitbarmase