anthropics / anthropics/claude-code

Terminal output copy loses markdown formatting and /copy bug

オープン
#92,497 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:tui bug platform:linux
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

**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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
markdown, python
領域
cli, content
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。