Bug: /copy fails with "Connection refused" — snap package missing x11/wayland plug
Nessuno ha ancora preso questa issue.
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
Describe the bug
On Linux, the /copy command in GitHub Copilot CLI fails with:
Failed to copy to clipboard: Error: Failed to create clipboard context: Connection refused (or error 111)
Root Cause
The Linux distribution of Copilot CLI is packaged as a snap, and the snap's declared interfaces do not include x11 or wayland. Clipboard access on Linux requires a direct connection to the X11 (or Wayland) display server socket, which snap's confinement blocks unless the snap explicitly declares and connects one of those interfaces. Since neither is declared, there is no snap connect command available to fix this — the plug simply doesn't exist in the snap's metadata.
Affected version
1.0.70 (Install method: snap /snap/copilot-cli/53/bin/copilot)
Steps to reproduce the behavior
- Install/run GitHub Copilot CLI via the snap package on a Linux desktop with an active X11 session.
- Start an interactive session and let the assistant produce any response.
- Run
/copyto copy the last response to the system clipboard.
Expected behavior
The last assistant response is copied to the system clipboard, as documented in /help:
/copy - Copy the last response to the clipboard
Additional context
OS/Environment
- OS/session: Ubuntu-based Linux desktop, X11 session (
XDG_SESSION_TYPE=x11,DISPLAY=:1) - Desktop Environment: GNOME desktop (
gnome-terminal-server) - Streaming Protocol: Amazon DCV/WSP streaming protocol (AWS WorkSpaces), accessed via the AWS WorkSpaces client on macOS (Apple Silicon MacBook Pro)
- Terminal emulator: gnome-terminal
Diagnostic Steps & Evidence
- Clipboard Works Separately: Copy/paste between other applications in the same session (terminal, text editor, browser) works correctly. This rules out broken X11 sessions, window manager clipboard mechanisms, or remote-desktop bridging problems. The issue is unique to the Copilot CLI process.
- Snap Confinement Restrictions: Running commands inside the CLI's shell tool environment yields permission blocks:
/usr/bin/snapreturnsPermission denied(exit code 126).- Running a normal executable (
venv/bin/python, mode0755owned by current user) returnsPermission denied(exit code 126). xset qreports the X server as unreachable when run from inside the CLI's shell tool.
- Missing Plugs:
snap connections copilot-clishows the snap only requestsdesktop/desktop-legacybut lacksx11andwayland:
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando i metadati del pacchetto snap e verificando le interfacce esposte da snap connections copilot-cli; l'issue identifica i plug x11 e wayland mancanti come causa sospetta. Riproduci /copy in una sessione desktop Linux, quindi verifica che lo snap esponga l'accesso al display necessario e che il comando copi correttamente l'ultima risposta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- linux
- Ambito
- cli, devops, operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100