Problem
The terminal TUI has no way to copy conversation content to the clipboard. To
grab an assistant reply a user has to mouse-select it, which is awkward in a
full-screen TUI and breaks entirely over SSH or inside tmux. Every other
surface (Desktop) can copy replies; the TUI cannot.
Proposal
Add a /copy slash command:
/copy — copy the last assistant reply (plain text) to the system
clipboard. This is the common case.
/copy all — copy the whole conversation (user + assistant turns,
with role labels) as plain text.
Mechanism: OSC 52
Write to the clipboard with the OSC 52 escape sequence
(ESC ] 52 ; c ; <base64> BEL) via the terminal, rather than shelling out to
pbcopy/xclip/wl-copy. OSC 52:
- works across SSH — the sequence rides the same stream as the rendered UI
and reaches the user's real terminal, not the remote host;
- needs no external binary and no new dependency;
- is the standard approach for terminal-first tools.
tmux is auto-detected (via $TMUX) and the sequence is wrapped in tmux's DCS
passthrough. Note: OSC 52 is fire-and-forget (no acknowledgement), so terminals
that don't support it (e.g. macOS Terminal.app, or tmux without
set-clipboard on) will silently no-op — an accepted limitation of the
protocol.
Behavior details
- Read-only and independent of the running turn (
midTurn: 'local'), so it can
copy the last reply while a new turn streams — same disposition as
/transcript.
- When there is nothing to copy yet, show a notice instead of writing an empty
clipboard.
- Localized (en/zh) confirmation notices, following the existing TUI copy
catalog.
Scope
- TUI only (
surfaces: ['tui'], session: 'required').
- New command registered in the slash-command catalog + a handler in the TUI
runner; a small pure OSC 52 helper and transcript-text helper, both unit
tested.
Problem
The terminal TUI has no way to copy conversation content to the clipboard. To
grab an assistant reply a user has to mouse-select it, which is awkward in a
full-screen TUI and breaks entirely over SSH or inside tmux. Every other
surface (Desktop) can copy replies; the TUI cannot.
Proposal
Add a
/copyslash command:/copy— copy the last assistant reply (plain text) to the systemclipboard. This is the common case.
/copy all— copy the whole conversation (user + assistant turns,with role labels) as plain text.
Mechanism: OSC 52
Write to the clipboard with the OSC 52 escape sequence
(
ESC ] 52 ; c ; <base64> BEL) via the terminal, rather than shelling out topbcopy/xclip/wl-copy. OSC 52:and reaches the user's real terminal, not the remote host;
tmux is auto-detected (via
$TMUX) and the sequence is wrapped in tmux's DCSpassthrough. Note: OSC 52 is fire-and-forget (no acknowledgement), so terminals
that don't support it (e.g. macOS Terminal.app, or tmux without
set-clipboard on) will silently no-op — an accepted limitation of theprotocol.
Behavior details
midTurn: 'local'), so it cancopy the last reply while a new turn streams — same disposition as
/transcript.clipboard.
catalog.
Scope
surfaces: ['tui'],session: 'required').runner; a small pure OSC 52 helper and transcript-text helper, both unit
tested.