github / github/copilot-cli

/copy shows clipboard error but still copies successfully

Aberta
#3,521 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

### Describe the bug

When using the `/copy` command, the CLI displays an error:

```
✗ Failed to copy to clipboard: Error: Failed to create clipboard context:
$DISPLAY variable not set and no value was provided explicitly
```

However, the content **is** successfully copied to the clipboard (presumably
via OSC 52 fallback or similar terminal-native mechanism).

The error from the first clipboard backend attempt is surfaced to the user
even though the overall operation succeeds.

### Affected version

GitHub Copilot CLI 1.0.54

### Steps to reproduce the behavior

1. Run Copilot CLI inside a devcontainer (no X11/Wayland available)
2. Have a conversation with some output
3. Type `/copy`
4. Observe the error message (prefixed with ✗)
5. Paste elsewhere — the content was copied successfully

### Expected behavior

If the copy ultimately succeeds via a fallback backend, no error should be
shown. The error should only appear if ALL clipboard backends fail.

### Additional context

- Environment: DDEV-based devcontainer using
`ghcr.io/devcontainers/features/copilot-cli:1`
- No `$DISPLAY` is set (headless Docker container)
- Terminal: iTerm2 on macOS, connected to the devcontainer
- iTerm2 has "Applications in terminal may access clipboard" enabled
- iTerm2 supports OSC 52 clipboard escape sequences
- The ✗ prefix and "Failed" wording suggest a hard failure to the user,
but the operation actually succeeds

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece pelo comando `/copy` e pelo tratamento do backend da área de transferência, depois reproduza o comportamento em um devcontainer headless sem `$DISPLAY`. Está concluído quando uma cópia de fallback bem-sucedida não produz nenhum erro, enquanto um erro é exibido somente quando todos os backends da área de transferência falham.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
shell
Domínio
cli
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
65/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.