Remove leading two-space indent from prompts
Open 💬 10 comments Opened Dec 18, 2025 by PaulRBerg
What feature would you like to see?
When Codex displays prompts (e.g., system instructions, user prompts), it adds a two-space indent to each line. This makes copy-pasting prompts cumbersome because the pasted text retains the unwanted indentation.
Request: Remove the leading two-space indent from prompt output so that prompts can be copy-pasted directly without needing to strip whitespace.
<img width="600" src="https://github.com/user-attachments/assets/327c444b-982f-4881-a4ed-b9755ac3171b" />
Additional information
- Codex version: codex-cli 0.73.0
- Platform: Darwin 25.2.0 arm64 arm
10 Comments
This would be very much appreciated this end.
Beautiful form follows beautiful function.
Perhaps a --tight-output flag so as not to disturb those this issue doesn't bother?
codex-cli 0.77.0
Linux 6.8.0-90-generic x86_64
Ubuntu 24.04.3 LTS (Noble Numbat)
yes this should exist as a feature flag
Please do this. It becomes a time sink to manage the text when you're having codex output commands to run.
Here's a workaround I just came up with. I run it in another terminal after the agent has finished responding, and I get its last message without the extra indentation. Then I can copy properly from there. Helps both with indentation issues and when codex outputs what should be long one-liners. Not a solution, but a good enough workaround for me.
tail -n1 $(ls -t ~/.codex/sessions/*/*/*/*.jsonl | head -n1) | jq -r '.payload.last_agent_message'@emilan Thanks for this! Had to use this for codex version 0.92.0:
How come this is not fixed yet?
It's a big part of frustration using Codex CLI and because ChatGPT Web interface becomes unusable and laggy mess after a long conversation, that's why I switched to Codex CLI (because CLI is just Text ,not React HTML garbage), but copy/pasting is terrible with 2 spaces padding always being there, why are all AI products not designed for daily use with stupid design decisions?
Anyone who has used these tools more than 5-10 minutes can spot usability problems immediately and these go not fixed like for months, and they want us to spend monthly subscriptions on these?
1.9K Issues 235 PRs might wanna put Codex work on those 🤦♂️
on codex-cli 0.118.0
Another example of why this is a great feature request is that codex frequently generates bash commands with heredocs, which don't work unless the indentation is manually stripped.
Codex will very often say things like this:
But this doesn't work if you just copy and paste as-is, because the
EOF(with two leading spaces) doesn't terminate the heredoc.The most frustrating part of this is that I can't work around it by just making a tighter selection with the mouse cursor - the only workaround I've found is to open a temporary editor buffer, paste the code into the buffer, manually unindent, paste into my terminal, then close the temporary editor buffer, which is a lot of steps and feels cumbersome.
I would looooove if the TUI had an explicit customization setting for
paddingwhich defaults to2as it does today, and we could set to0in theconfig.toml(or even making it a boolean setting liketrue|falsewould be perfect)I understand the reason for the padding (it looks nice), but I suspect it causes too much frustration for users in general, for the niceness to be worth it.
This feature should be a no-brainer to be included in the very first public release, but the ones lacking any real brain are the AI that wrote the code and the execs that signed off on
pretty>functionalPlease guys downvote to hell @etraut-openai because he says this is by "design" and closed as no planned...
https://github.com/openai/codex/issues/16431#issuecomment-4174267698
What a joke CLI without basic features when others have this fixed from beggining, Opencode is years light better than Codex in UI design.