Copy turn
The copy-turn extension lets you copy a user or assistant result from the current session branch using a short hash. It is useful when you want to reuse an earlier answer, a command output, or an assistant message without retyping it.
Bundled with Selesai
Loaded automatically with Selesai; no per-extension npm install is required.
Setup and prerequisites
- This extension is bundled with Selesai. It is loaded automatically; you do not need to install it separately.
- Available only in an interactive Selesai TUI session. RPC hosts have their own copy UI and do not receive terminal copy markers.
- Works only on messages in the current session branch. Messages are matched by a SHA-1 hash of their cleaned content.
What it sets up
- Registers a custom
copy-turnmessage renderer that adds a copy marker below user messages and appends a marker to the final assistant message of each turn. - Maintains a per-branch set of hashes by reading
ctx.sessionManager.getBranch(). - Uses
copyToClipboardfrom the Selesai runtime to copy matched content to the system clipboard.
What you can configure
Copy turn is a command-only extension. It accepts one argument and has no persistent settings.
This capability does not expose user-editable settings. Its behavior is controlled by the commands and runtime rules documented below.
Command, tool, and shortcut controls
| Key / path | Description |
|---|---|
/cp <hash> | Copy the content of the referenced user or assistant turn. |
Source evidence
src/extensions/copy-turn.tsCopy turn source
What you can do
- Copy a user or assistant message result to the clipboard by typing its hash.
- Use a short prefix as long as it is unambiguous. If multiple messages match, Selesai tells you the full hashes so you can disambiguate.
Commands, tools, and shortcuts
| Command | Description |
|---|---|
/cp <hash> | Copy the result of the matching message to the clipboard. |
The matching messages are filtered to the current branch, excluding custom copy-turn rows. For bashExecution messages the copied text is the command plus its output; for other roles it is the text content with the marker stripped.
Limits and safety
/cpworks on messages that are still in the current branch. Navigating to a different session branch changes the available hashes.- The hash is a content hash, so editing a message after it was rendered produces a different hash.
- Empty results and ambiguous prefixes are rejected with a warning.
- The extension removes copy markers from model context, so it does not inflate context with repeated markers.