Windows: Ctrl+V multiline paste executes immediately in Codex CLI while Shift+Insert pastes normally
Open 💬 7 comments Opened Mar 6, 2026 by Wolfyerk
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
Windows: Ctrl+V multiline paste executes immediately in Codex CLI while Shift+Insert pastes normally
Environment
- OS: Windows 10 22H2 (
10.0.19045) - Shell: PowerShell
7.5.4 - PSReadLine:
2.3.6 - Codex CLI package:
@openai/codex 0.111.0 - Date observed:
2026-03-06
Summary
Inside Codex CLI on Windows, pasting multiline text with Ctrl+V immediately executes on newline instead of staying in the input buffer.
Shift+Insert pastes normally.
The same PowerShell environment outside Codex CLI does not reproduce the problem.
Reproduction
- Start Codex CLI on Windows.
- Copy multiline text to the clipboard.
- Paste with
Ctrl+V.
Expected
- The pasted text should appear in the composer/input buffer.
- Nothing should execute until explicit
Enter.
Actual
- The pasted text is inserted and immediately starts executing on newline.
- This makes it impossible to safely paste multiline fragments via
Ctrl+V. Shift+Insertstill works.
Local diagnostics
Ctrl+VandShift+Insertare both bound toPasteinPSReadLine.- PowerShell profiles are clean.
- Windows Terminal settings are clean enough that the issue looks Codex-CLI-specific rather than PowerShell-specific.
- A stale
GITHUB_TOKENwas present locally but invalid; unrelated to the paste bug itself.
Related older issues
#10888"Paste text to the codex CLI via CTRL+V keyboard combination is broken"#2137multiline paste on Windows auto-submits#5808multi line pasting no longer works#5172instant starts sometimes on pasting text
This looks like the same class of Windows paste/input-handling regression still being reproducible in current builds.
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Correction: the full multiline text is not inserted. Only the first line is pasted, and Codex CLI immediately auto-submits after that.
In my case, I was pasting a multiline text block. The first line (
Пригодны:) appeared, but the rest of the multiline payload was not inserted. Right after that, Codex CLI started execution automatically.That makes this much closer to the old Windows multiline paste / auto-submit bug in #2137 than to #13580. #13580 is about Ctrl+V paste support/behavior in general, while this issue is specifically about broken multiline text paste leading to first-line-only insertion plus immediate submit.
Since #2137 was previously closed as fixed, this looks more like a regression or an uncovered Windows terminal variant on
@openai/codex 0.111.0.same issue
same , no bracket pasting mode any more. codex-cli 0.115.0, and PowerShell 7.6.0-rc.1.
I can reproduce a closely related paste/input handling issue on Windows, and in my environment it is not limited to
Ctrl+V.## Environment
10.0.26200, x64WT_SESSIONis set)7.6.22.4.5codex-cli 0.135.0v24.14.011.9.0## Additional reproduction
I tested multiline paste with these shortcuts inside Codex CLI:
Ctrl+VShift+InsertCtrl+Shift+VAll three show problematic behavior for me.
## Actual behavior
When pasting multiline content, Codex CLI does not keep the full pasted text in the composer/input buffer.
Instead, the pasted content appears to be submitted as soon as the first newline is received. In my tests, the first line/sentence is submitted, Codex starts responding, and I have to press
Esctointerrupt/cancel it.
This makes multiline paste unsafe because simply pasting text can trigger execution/submission before I explicitly press
Enter.## Expected behavior
Multiline pasted text should be inserted into the input buffer as a paste transaction.
Nothing should be submitted or executed until I explicitly press
Enter.This should work consistently for Windows Terminal / PowerShell paste paths, including
Ctrl+V,Shift+Insert, andCtrl+Shift+V.## Notes
In plain PowerShell outside Codex CLI,
Ctrl+VandShift+Insertare both bound toPastein PSReadLine and do not show the same immediate-submit behavior.The original report says
Shift+Insertpasted normally for that environment, but on my machineShift+Insertalso reproduces the issue. So this may depend on the Windows terminal/input path rather than onlyone specific key binding.
Reproduction notes and proposed fix path
I took a pass at reducing this to an actionable code path before suggesting a fix.
Breakdown:
Proposed approach:
Precedent: #29189 Codex Desktop 26.616.41845 node_repl fails: codex/sandbox-state-meta missing sandboxPolicy
How I shaped this comment from prior successful threads:
This analysis was prepared with AI assistance.
<!-- fkst:codex-saga:engage:codex-triage:dup:openai/codex#13729 -->
Additional reproduction from a Windows user:
Environment
Reproduction
Actual behavior
Codex does not retain the paste as one multiline block. Newline boundaries are treated as submission/execution, so the instructions are sent line by line before the user explicitly presses Enter.
Control comparison
The same terminal and PowerShell 7 environment do not reproduce this behavior with Claude CLI, agy, or OpenCode. This strongly suggests that the problem is in Codex CLI's TUI/input paste handling rather than PowerShell itself.
Expected behavior
The entire clipboard payload should be inserted into the composer as a single paste transaction, preserving newlines, and must not submit anything until the user explicitly presses Enter.
Please prioritize a regression fix and add Windows multiline-paste coverage for the TUI input path.