Pasted newline auto-submits

Resolved 💬 5 comments Opened Aug 8, 2025 by zemaj Closed Nov 21, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.19.0

Which model were you using?

gpt-5

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

  1. Open codex CLI
  2. Paste multi-line text that contains a new line part way through it.
  3. First newline submits immediately and only the part before the newline is sent to codex. The rest only appears once codex stops running (and is not submitted)

What is the expected behavior?

Pasting newlines should be the same as pressing Shift+Enter - new line in the input.

What do you see instead?

Incomplete automatic submission

Additional information

This breaks all kinds of workflows including using TTS tools like Flow if they insert a new line in the text while you're talking.

View original on GitHub ↗

5 Comments

mariusmercier · 1 year ago

Same issue on WSL2.

zemaj · 1 year ago

I think I found a work-around. I had "Terminal may enable paste bracketing" disabled in iTerm2. When I enabled it, the problem was resolved.

Has not been an issue with Claude - so still worth addressing.

Zamaroht · 1 year ago

Found any workaround for powershell?

youurayy · 11 months ago

Turning on "paste bracketing" solves this.

For me this was happening when the pasted multiline text contained code blocks (```). It would treat each line in the code block as new message for codes -- pretty disastrous if unnoticed by the user.

codex-cli 0.39.0, Mac, iTerm2

etraut-openai contributor · 9 months ago

I think this was fixed long ago on MacOS and Linux. On Windows, it's being tracked by #2137