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

  1. Start Codex CLI on Windows.
  2. Copy multiline text to the clipboard.
  3. 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+Insert still works.

Local diagnostics

  • Ctrl+V and Shift+Insert are both bound to Paste in PSReadLine.
  • PowerShell profiles are clean.
  • Windows Terminal settings are clean enough that the issue looks Codex-CLI-specific rather than PowerShell-specific.
  • A stale GITHUB_TOKEN was 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"
  • #2137 multiline paste on Windows auto-submits
  • #5808 multi line pasting no longer works
  • #5172 instant starts sometimes on pasting text

This looks like the same class of Windows paste/input-handling regression still being reproducible in current builds.

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 4 months ago

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

  • #13580

Powered by Codex Action

Wolfyerk · 4 months ago

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.

neavo · 4 months ago

same issue

zququ · 4 months ago

same , no bracket pasting mode any more. codex-cli 0.115.0, and PowerShell 7.6.0-rc.1.

sandynz · 1 month ago

I can reproduce a closely related paste/input handling issue on Windows, and in my environment it is not limited to Ctrl+V.

## Environment

  • OS: Windows 11 Pro, 10.0.26200, x64
  • Terminal: Windows Terminal (WT_SESSION is set)
  • Shell: PowerShell 7.6.2
  • PSReadLine: 2.4.5
  • Codex CLI: codex-cli 0.135.0
  • Node.js: v24.14.0
  • npm: 11.9.0

## Additional reproduction

I tested multiline paste with these shortcuts inside Codex CLI:

  • Ctrl+V
  • Shift+Insert
  • Ctrl+Shift+V

All 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 Esc to
interrupt/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, and Ctrl+Shift+V.

## Notes

In plain PowerShell outside Codex CLI, Ctrl+V and Shift+Insert are both bound to Paste in PSReadLine and do not show the same immediate-submit behavior.

The original report says Shift+Insert pasted normally for that environment, but on my machine Shift+Insert also reproduces the issue. So this may depend on the Windows terminal/input path rather than only
one specific key binding.

ctkm-aelf · 18 days ago

Reproduction notes and proposed fix path

I took a pass at reducing this to an actionable code path before suggesting a fix.

Breakdown:

  • I treated the report as reproducible enough to trace against the current code instead of asking for more information.
  • Root cause: codex-rs/tui/src/bottom_pane/paste_burst.rs:400
  • Impact: calibrated priority score 71.8

Proposed approach:

  • Keep the patch scoped to the code path around codex-rs/tui/src/bottom_pane/paste_burst.rs:400, so the behavior changes where the regression is introduced rather than broadening the surface area.
  • Validation plan: add or update focused regression coverage and run the affected package test target before proposing the branch
  • I will not open an unsolicited PR; if this direction matches maintainer expectations, I can open the prepared branch for review.

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:

  • Nearest successful examples considered: 3.
  • The shared pattern was to show the repro/root-cause evidence first, state the smallest viable fix, defer to maintainers on direction, and disclose AI assistance.

This analysis was prepared with AI assistance.

<!-- fkst:codex-saga:engage:codex-triage:dup:openai/codex#13729 -->

Takayuki-Iitsuka · 2 days ago

Additional reproduction from a Windows user:

Environment

  • OS: Windows 11
  • Shell: PowerShell 7
  • Codex CLI: version not captured in this report

Reproduction

  1. Start Codex CLI from the PowerShell 7 terminal.
  2. Copy a multiline text block.
  3. Paste it into the Codex CLI input.

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.