github / github/copilot-cli

The /copy command does not work in WSL

オープン
#4,619 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

triage
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、WSL2/WSLg で /copy を再現し、その clip.exe の呼び出しを、動作するコマンド echo test | clip.exe と比較します。CLI のクリップボードフォールバックとネイティブクリップボードの選択を追跡し、その後、最新の Copilot の応答が Unicode と大きな入力で正常にコピーされ、新しい出力を生成しないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
linux, shell
領域
cli, operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。