From 659586a849d6159aca1efb74a9abba584a31ae6d Mon Sep 17 00:00:00 2001 From: Nick Driver <6147794+TheDr1ver@users.noreply.github.com> Date: Wed, 22 Jul 2026 22:43:22 -0400 Subject: [PATCH] docs: add WSL2 clipboard workaround Document the safe, idempotent workaround while the runtime source fix remains pending. Refs #3534 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4ee25ec0-30f6-4e96-ac2f-ea35074113a6 --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 347cf2dc..ec617773 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,39 @@ npm install -g @github/copilot npm install -g @github/copilot@prerelease ``` +#### WSL2 clipboard workaround + +On affected WSL2 installations, `/copy` and other clipboard actions can fail +with `clip.exe exited with code 1` because the `cmd.exe` wrapper incorrectly +quotes the Windows `clip.exe` path. See +[issue #3534](https://github.com/github/copilot-cli/issues/3534). The issue was +still reproducible in version `1.0.74-3`. + +Until a source fix ships, the following idempotent workaround patches the +latest downloaded CLI bundle and keeps a backup. Restart Copilot CLI after +running it, and re-run it after each `/update`. + +```bash +case "$(uname -m)" in + aarch64|arm64) platform="linux-arm64" ;; + x86_64|amd64) platform="linux-x64" ;; + *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; +esac + +pkg_root="$HOME/.cache/copilot/pkg/$platform" +test -d "$pkg_root" || { echo "No Copilot CLI package found" >&2; exit 1; } +version="$(find "$pkg_root" -mindepth 1 -maxdepth 1 -type d \ + -printf '%f\n' | sort -V | tail -n 1)" +test -n "$version" || { echo "No Copilot CLI package found" >&2; exit 1; } + +for file in "$pkg_root/$version/app.js" "$pkg_root/$version/sdk/index.js"; do + test -f "$file" || continue + if grep -Fq 'chcp 65001 >nul & "${e}"' "$file"; then + cp "$file" "$file.bak-clipfix" + sed -i 's|chcp 65001 >nul & "${e}"|chcp 65001 >nul \& ${e}|g' "$file" + fi +done +``` ### Launching the CLI