PLEASEEEE fix copy pasting from the CLI output

Open 💬 6 comments Opened May 27, 2026 by nullbio
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

It's so annoying trying to copy paste from the CLI, which is something that everyone does quite frequently. It's especially annoying when the thing you're copying spans multiple lines, and you're copying linux commands.

Firstly, it copies line breaks when the text wraps, when it shouldn't. Secondly, it copies extra spaces at the beginning of every line. All of these need to be removed quite frequently, manually.

Yes, I know there is a /copy, but if you're copying linux commands or only a partial section of the text, you want to be able to just copy and paste straight away, not have to remove things.

Perhaps the best way to handle this would be to have a more advanced /copy feature that actually lets you interactively choose the paragraph or the terminal command that you're copying. It could intelligently parse the last response and break it down into sections that can be selected using arrow keys or quick-action numbers.

That's a fallback if there's no way to fix the actual TUI highlighting problems. Although I swear I've seen other CLIs solve this issue (maybe it was OpenCode that solves it?)

Additional information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #24073

Powered by Codex Action

GRGAINZ · 1 month ago

Being able to copy a presented plan in planning mode would also be useful, at the minute you have to esc then /copy which removes the planning implementation options.

You are correct with opencode too, their text selection is way more advanced.

josh-sachs · 1 month ago

this is not an issue in Claude Code - so there is a solution that exists, but just isn't in Codex CLI yet...

/copy to get at the last response as markdown is NOT a workaround.

ChristophShyper · 1 month ago

Would be nice if we could just select some text in terminal output and just copy it...

I hate to fix line breaks and 2 whitespaces for every paragraph I want to copy. Need to vide-code a simple app for fixing it...

nullbio · 1 month ago

Just so everyone is aware: alt+R enables raw mode. In raw mode, copying doesn't have this problem. @ChristophShyper @josh-sachs @GRGAINZ

ChristophShyper · 1 month ago

@nullbio Thanks, works with opt + R. Toggling it constantly is for sure easier using intermediate wrapper.