You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove leading two-space indent from prompts #8258
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.
Additional information
Codex version: codex-cli 0.73.0
Platform: Darwin 25.2.0 arm64 arm
Reacted by santiago-afonso, simonallfrey, Robin | Liquidium, belyay, Wouter Coppieters, Kam Lotfull, hamasho, Storhemulen, Matthias Thym, Yiding Cui and 31 more
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.
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 🤦♂️
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:
• Try this command:
cat <<EOF
foo
bar
EOF
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 padding which defaults to 2 as it does today, and we could set to 0 in the config.toml (or even making it a boolean setting like true|false would 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.
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:
• Try this command:
cat <<EOF
foo
bar
EOF
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 padding which defaults to 2 as it does today, and we could set to 0 in the config.toml (or even making it a boolean setting like true|false would 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>functional
This is no longer an issue when using the default fullscreen mode. Copies in this mode ignore any incidental formatting and copy the underlying contents.
Activity
simonallfrey commentedon Dec 29, 2025
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)
robin-liquidium commentedon Jan 3, 2026
yes this should exist as a feature flag
pgibler commentedon Feb 8, 2026
Please do this. It becomes a time sink to manage the text when you're having codex output commands to run.
emilan commentedon Feb 18, 2026
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'totoroot commentedon Feb 24, 2026
@emilan Thanks for this! Had to use this for codex version 0.92.0:
ZaDarkSide commentedon Mar 22, 2026
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 🤦♂️
verhovsky commentedon Apr 8, 2026
on codex-cli 0.118.0
bduffany commentedon Apr 9, 2026
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.
ZaDarkSide commentedon Apr 9, 2026
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>functionaldhaern commentedon Apr 11, 2026
Please guys downvote to hell @etraut-openai because he says this is by "design" and closed as no planned...
#16431 (comment)
What a joke CLI without basic features when others have this fixed from beggining, Opencode is years light better than Codex in UI design.
feat(tui): add raw scrollback mode (#20819)
feat(tui): add raw scrollback mode (openai#20819)
[-][FEATURE] Remove leading two-space indent from prompts[/-][+]Remove leading two-space indent from prompts[/+]feat(tui): add raw scrollback mode (openai#20819)
etraut-openai commentedon Oct 12, 2026
This is no longer an issue when using the default fullscreen mode. Copies in this mode ignore any incidental formatting and copy the underlying contents.