anthropics / anthropics/claude-code

Terminal output copy loses markdown formatting and /copy bug

Aperta
#92,497 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:tui bug platform:linux
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

**Description**

When selecting and copying Claude's response text from the terminal, the copied text contains only the rendered plain text — the original markdown source (`# headers`, `**bold**`, `backticks,`code fences, `- list markers`, table syntax) is not preserved.

Further, the `/copy` command is limited to the last output, and which breaks if the user issues commands after.

**Steps to reproduce**

1. Run `claude` in a terminal.
2. Ask a question that produces a formatted response (e.g. one containing a code block, a table, and bold text).

Terminal copy
3. Select the response in the terminal and copy it.
4. Paste into a markdown-aware destination (GitHub comment, Slack, an editor).

`/copy` limitations
3. Issue another command like `/rename`
4. Issue `/copy`

**Expected behavior**

If there is some technical means to do so, modifying what gets put in the clipboard on a usual copy to be markdown-formatted would be ideal.

If not, perhaps, an enhancement to `/copy` that lets you choose one of the last 10 outputs with summaries or leading text shown in the TUI chooser.

**Actual behavior**

Only the rendered terminal text can be copied. Structure is partially or fully lost: code fences and inline code lose their backticks, bold/italic markers are gone, tables copy as box-drawing characters, and wrapped lines pick up hard line breaks from the terminal width.

`/copy` does not copy anything when an output-producing command is issued after the agent's finished turn.

**Environment**

- Platform: linux
- Terminal: xterm-256color (kitty)
- Version: 2.1.259
- Feedback ID: `17423596-9b6c-44ca-b235-4630e060d705`

Workaround

- Asking Claude to write the response to a file, or digging the raw text out of the session transcript under `~/.claude/projects/` — both clunky for a quick copy-paste.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Reproduce the terminal-selection copy and /copy cases, including issuing /rename afterward, then trace the /copy command and the session transcript under ~/.claude/projects/. Done means copied responses preserve markdown structure and /copy still selects the intended earlier output after subsequent commands, with the chosen behavior verified in the TUI.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
markdown, python
Ambito
cli, content
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.