The /copy command does not work in WSL
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
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
- Launch WSL from Windows.
- From WSL, start a copilot-cli session.
- Send copilot a prompt and wait for a response.
- Use the
/copycommand to copy the copilot response to the clipboard. - 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, /copy unter WSL2/WSLg zu reproduzieren und seinen clip.exe-Aufruf mit dem funktionierenden Befehl echo test | clip.exe zu vergleichen. Verfolge das Clipboard-Fallback der CLI und die Auswahl der nativen Zwischenablage, und überprüfe anschließend, dass die neueste Copilot-Antwort mit Unicode und großen Eingaben erfolgreich kopiert wird, ohne neue Ausgabe zu erzeugen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- linux, shell
- Bereich
- cli, operating-systems
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100