github / github/copilot-cli

The /copy command does not work in WSL

Ouverte
#4,619 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

triage
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire /copy sous WSL2/WSLg et comparez son invocation de clip.exe avec la commande fonctionnelle echo test | clip.exe. Suivez le fallback du presse-papiers de la CLI et la sélection du presse-papiers natif, puis vérifiez que la dernière réponse de Copilot est copiée correctement avec Unicode et des entrées volumineuses sans produire de nouvelle sortie.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
linux, shell
Domaine
cli, operating-systems
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.