kimi-code/docs/en/reference
liruifengv a5c568dc7a
feat(tui): add /copy slash command to copy the last assistant message (#1822)
* feat(tui): add /copy slash command to copy the last assistant message

The command copies the latest assistant reply (text parts only, skipping thinking, tool-call-only turns, error and internal messages) to the clipboard. Clipboard writes now also emit an OSC 52 sequence (tmux-aware) so copying keeps working over SSH and in containers where no native clipboard tool exists.

* fix(tui): gate /copy to idle and report OSC 52-only copies as unverified

During streaming the in-flight assistant text is not in getContext() history yet, so /copy would silently copy an older message; make the command idle-only like /export-md. copyTextToClipboard now returns how the text was delivered so /copy can say when only an unverified OSC 52 escape carried it.

* fix(tui): source /copy text from the visible transcript

After /compact the model context keeps only user messages plus a user-role summary, so scanning it found no assistant message even though the last reply is still on screen. Read the last assistant transcript entry instead — it matches what the user sees and survives compaction and resume.

* fix(tui): mark real model text in the transcript so /copy skips synthetic cards

Hook-result and goal-completion cards are also 'assistant' transcript entries appended after the real reply, so /copy could copy a hook card instead of the answer. Tag the single entry-creation site for genuine model text (both live and replay flow through it) and have /copy only accept tagged entries.
2026-07-17 16:39:19 +08:00
..
keyboard.md feat(tui): show compaction summary with Ctrl-O (#1346) 2026-07-06 13:32:37 +08:00
kimi-acp.md mcp suport sse (#744) 2026-06-14 18:04:26 +08:00
kimi-command.md docs(server): document --dangerous-bypass-auth and --keep-alive flags (#1373) 2026-07-04 18:33:22 +08:00
slash-commands.md feat(tui): add /copy slash command to copy the last assistant message (#1822) 2026-07-17 16:39:19 +08:00
tools.md feat(agent-core): drop default timeouts for print-mode background tasks (#1737) 2026-07-15 14:35:32 +08:00