github / github/copilot-cli

The /copy command does not work in WSL

Open
#4,619 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

Describe the bug

/copy  fails under WSL2/WSLg with Failed to copy to clipboard: Error: clip.exe exited with code 1 .  But echo test | clip.exe  reliably works, including from the repository and with Unicode/large input. The bundled native clipboard module fails first because WSLg’s Wayland compositor lacks  ext-data-control / wlr-data-control ; forcing X11 by unsetting WAYLAND_DISPLAY  makes native clipboard copy work. The CLI’s  clip.exe  fallback appears to invoke  clip.exe  incorrectly, likely passing text as an argument instead of stdin.

Affected version

GitHub Copilot CLI 1.0.80.

Steps to reproduce the behavior
  1. Launch WSL from Windows.
  2. From WSL, start a copilot-cli session.
  3. Send copilot a prompt and wait for a response.
  4. Use the /copy command to copy the copilot response to the clipboard.
  5. Observe the following error message:
    Failed to copy to clipboard: Error: clip.exe exited with code 1
Expected behavior

No new Copilot output, but the latest Copilot response gets copied to the clipboard a.k.a. copy/paste buffer, ready to paste elsewhere.

Additional context

My actual use-case is more deeply nested than this. I'm running Kubuntu 26.04 on a laptop, then launching a Windows VDI via Citrix Workspace. I run WSL from within the Windows VDI, and GitHub Copilot from within WSL.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing /copy under WSL2/WSLg and compare its clip.exe invocation with the working command echo test | clip.exe. Trace the CLI's clipboard fallback and native clipboard selection, then verify that the latest Copilot response copies successfully with Unicode and large input without producing new output.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.