Multiline paste in Codex CLI submits the first line immediately and leaves remaining lines in the input box

Open 💬 3 comments Opened Jul 7, 2026 by Traveller23

What version of Codex CLI is running?

codex-cli 0.142.5

What subscription do you have?

Business

Which model were you using?

gpt-5.5

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal (PowerShell)

Codex doctor report

What issue are you seeing?

When pasting a multiline message into Codex CLI, only the first line is submitted immediately, while the remaining lines stay in the input box.

This makes it difficult to paste normal multiline prompts, especially prompts that contain bullet lists, file paths, or multi-paragraph bug reports.

<img width="834" height="344" alt="Image" src="https://github.com/user-attachments/assets/6d8bda86-0599-4247-96e2-d6a0f52f5696" />

What steps can reproduce the bug?

  1. Open Codex CLI in a project directory.
  2. Copy the following multiline text from VS Code:
有几个问题:
- 新的 workflow tree 相比之前的缺少某些步骤, 请对比 "C:\Users\Pello\Downloads\before redesign.png" 和 ".agents/cached-results/observer-issue06-model-output.png".
- 新的 workflow tree 几乎变成扁平的了, 原来 step 最多有两层缩进, 现在没有缩进, 硬要说的话最多一层. 每个步骤左侧表示缩进的图标也有问题, 没有对齐.
- 和之前的设计稿 (.scratch/example-observer-desktop-redesign/assets/reference-1-production-tool.png) 对比, 现在缺少时间轴轨道, 每个步骤的耗时并不是完全统一单位 (00:00.000), 步骤没有真实图标还是文字缩写.
  1. Paste it into the Codex CLI input box.
  2. Observe the behavior.

What is the expected behavior?

Pasting multiline text should preserve the entire pasted content as one draft message.

Codex CLI should not submit automatically just because the pasted text contains newline characters. The user should be able to review or edit the pasted multiline prompt and submit it explicitly.

Expected draft content after paste:

有几个问题:
- 新的 workflow tree 相比之前的缺少某些步骤, 请对比 "C:\Users\Pello\Downloads\before redesign.png" 和 ".agents/cached-results/observer-issue06-model-output.png".
- 新的 workflow tree 几乎变成扁平的了, 原来 step 最多有两层缩进, 现在没有缩进, 硬要说的话最多一层. 每个步骤左侧表示缩进的图标也有问题, 没有对齐.
- 和之前的设计稿 (.scratch/example-observer-desktop-redesign/assets/reference-1-production-tool.png) 对比, 现在缺少时间轴轨道, 每个步骤的耗时并不是完全统一单位 (00:00.000), 步骤没有真实图标还是文字缩写.

Additional information

This issue may only occur when the first line contains Chinese, Japanese, or Korean characters. Removing the first line, or changing the text in the first line to English (without changing the subsequent lines), will prevent the issue from happening.

VS Code text file status bar: <img width="369" height="43" alt="Image" src="https://github.com/user-attachments/assets/db6e7c3d-7d80-4a30-b05f-ae1f44d54b8a" />

View original on GitHub ↗

3 Comments

gotisama · 22 days ago

This issue still hasn’t been fixed in the latest CLI version, 0.146.1.

starSumi · 21 days ago

I reproduced this symptom against current main (0bdce9f424) at the composer paste-burst boundary.

The non-bracketed fallback path currently does the following:

  1. A rapid KeyCode::Char stream becomes a PasteBurst.
  2. A UI tick calls flush_if_due, which emits FlushResult::Paste while intentionally retaining burst_window_until so a following Enter remains part of the paste.
  3. ChatComposer::handle_paste_burst_flush forwards that text to handle_paste.
  4. handle_paste calls clear_after_explicit_paste, which clears burst_window_until.
  5. An immediately following Enter can therefore submit the flushed first line instead of inserting a pasted newline.

I added a composer-level regression test, timed_burst_flush_preserves_enter_suppression_for_next_event. With the current call path restored, it fails consistently at the expected assertion: the Enter event submits instead of inserting a newline. Separating explicit terminal paste cleanup from timed burst-flush cleanup makes the test pass.

Candidate patch: https://github.com/starSumi/codex/commit/3f4c3972b791cb93b4acf939a16af561d7d5cee6

Validation on Windows:

  • cargo fmt --all -- --check
  • focused regression test: 1 passed
  • reverting only the timed-flush call: 2 attempts failed at the expected assertion
  • all paste/burst-filtered codex-tui tests: 67 passed

I have not completed a manual Windows Terminal interaction check, so I am not claiming the patch is ready for a code PR. I also did not open a PR because the repository contribution guidance says external PRs are by invitation.

Etsuya233 · 2 days ago

I encountered this issue multiple time per day. Hopefully it will be fixed sooooooooooooooon. 😭