github / github/copilot-cli

The /copy command does not work in WSL

Abierto
#4,619 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

triage
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza reproduciendo /copy en WSL2/WSLg y compara su invocación de clip.exe con el comando funcional echo test | clip.exe. Sigue el fallback del portapapeles de la CLI y la selección del portapapeles nativo; después, verifica que la respuesta más reciente de Copilot se copie correctamente con Unicode y entradas grandes sin producir nueva salida.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
linux, shell
Área
cli, operating-systems
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.