anthropics / anthropics/claude-code

Terminal output copy loses markdown formatting and /copy bug

Đang mở
#92,497 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:tui bug platform:linux
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
markdown, python
Lĩnh vực
cli, content
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.