[FEATURE] optional feature/config for "copy on select"
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I often need to copy out commands from claude's output to paste into another place. I want to be able to copy them simply by highlighting the text (like in OpenCode) and for newlines from softwrapping to not show up as actual newlines in the copied text.
Proposed Solution
In OpenCode there is a feature where when you highlight text in the TUI from agent output, it automatically copies it, and also copies it without any softwrap showing up as newlines (related to this issue: https://github.com/anthropics/claude-code/issues/22073), so it can easily be pasted into another place.
I love this feature and would appreciate if it were added to Claude Code (possibly as a configurable option that could be turned on or off for those who want it)
Alternative Solutions
_No response_
Priority
Critical - Blocking my work
Feature Category
Interactive mode (TUI)
Use Case Example
I am using Claude Code to generate bash that I will execute in another terminal or server -- I want to copy the text out of Claude Code in a seamless and easy way so I can paste it into another terminal. I want to take one command at a time and not /copy the whole previous output.
Additional Context
_No response_
10 Comments
I hit this daily, would love to see it addressed.
Seconding this strongly. The OpenCode comparison is the right frame.
OpenCode renders plain text that terminals can natively select and copy. Claude Code's rich formatting (borders, colors, hard-wrap indentation) means any drag-select captures ANSI escape sequences and mangled line breaks — unusable without cleaning up manually.
Two things that would close this gap:
chat:copyLastResponsekeybinding action — lower-lift implementation path since the keybindings infrastructure already exists inkeybindings.json. Users could wire it to whatever key they want without needing a new UI elementThe keybinding action is probably the fastest path to ship something. The bindings registry is already there — it just needs the action. Power users would configure it immediately and it doesn't require any rendering changes.
Hit this constantly when pulling responses into docs, slides, and Slack.
My first week of using claude, and this is one of the easy QoL features I wish you guys had.
+1. One angle not yet raised: Claude Code's copy-on-select overrides the terminal's own setting. My Ghostty has
copy-on-select = falseexplicitly configured, but selecting inside Claude Code still writes to the clipboard via OSC 52. A user who has already expressed their preference via terminal config is being silently overridden — at minimum the TUI should defer to the terminal, or expose an opt-out setting.i very much agree with @Andy8647 , there should be an opt out setting at the very least, either through an environment variable or maybe follow the terminal preference
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This seems to have been implemented in a recent release, no?
yup seems to be working well
But it's missing a configuration option to turn it on/off...
This is now implemented and I hate it. And claude doesn't seem to know it exists. PLEASE LET US TURN THIS OFF!
This exists as a feature within terminal apps, which is where this level of preference belongs.