anthropics / anthropics/claude-code
Terminal output copy loses markdown formatting and /copy bug
- Vorherrschende Sprache
- Python
- Sterne
- 145k
- Forks
- 23.1k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
**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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- markdown, python
- Bereich
- cli, content
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100