codex - 💡(How to fix) Fix Regression: Alt+Enter no longer inserts newline in VS Code WSL terminal [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20501Fetched 2026-05-01 05:42:26
View on GitHub
Comments
3
Participants
3
Timeline
14
Reactions
1
Timeline (top)
labeled ×4commented ×3subscribed ×3mentioned ×2
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.128.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.5

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

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

VS Code Integrated Terminal over WSL VS Code 1.117.0 Commit 10c8e557c8b9f9ed0a87f61f1c9a44bde731c409 x64

What issue are you seeing?

In Codex CLI 0.128.0, Alt+Enter no longer inserts a newline when running inside the VS Code integrated terminal over WSL.

This used to work in previous versions. Enter submitted the message, while Alt+Enter inserted a newline in the composer.

The new /keymap command exists, but remapping newline to combinations such as Ctrl+Alt+J or Ctrl+Alt+X did not work in the VS Code integrated terminal. The same newline behavior works in the Ubuntu WSL.

What steps can reproduce the bug?

  1. Open VS Code connected to WSL.
  2. Open the VS Code integrated terminal.
  3. Run codex.
  4. Confirm the version is codex-cli 0.128.0.
  5. Type text in the composer.
  6. Press Alt+Enter.
  7. Observe that a newline is not inserted.

Optional:

  1. Open /keymap.
  2. Try mapping editor.insert_newline to Ctrl+Alt+J or Ctrl+Alt+X.
  3. Return to the composer.
  4. Press the configured key combination.
  5. Observe that the newline still does not work in the VS Code integrated terminal.

What is the expected behavior?

Alt+Enter should insert a newline in the composer when running Codex CLI in the VS Code integrated terminal over WSL.

Enter alone should continue submitting the prompt.

Additional information

This appears related to the keymap changes introduced after the previous composer behavior.

In older behavior, Enter with modifiers could fall through to the textarea logic and insert a newline. In 0.128.0, editor.insert_newline is controlled by the default runtime keymap, but the default bindings include Ctrl+J, Ctrl+M, plain Enter, and Shift+Enter, while Alt+Enter is not included.

A minimal fix appears to be adding Alt+Enter to the default editor.insert_newline bindings and adding a regression test that verifies KeyCode::Enter with KeyModifiers::ALT inserts a newline and does not submit the composer.

extent analysis

TL;DR

Adding Alt+Enter to the default editor.insert_newline bindings may resolve the issue with inserting newlines in the Codex CLI composer within the VS Code integrated terminal over WSL.

Guidance

  • Review the keymap changes introduced in Codex CLI version 0.128.0 to understand how editor.insert_newline is handled.
  • Attempt to manually add Alt+Enter to the default bindings for editor.insert_newline to see if it resolves the issue.
  • Consider adding a custom key binding using the /keymap command, although this has not worked in initial tests.
  • Verify that the issue is specific to the VS Code integrated terminal over WSL, as the behavior works correctly in the Ubuntu WSL terminal.

Example

No code snippet is provided as the issue seems related to key bindings and terminal behavior rather than code.

Notes

The fix may require updates to the Codex CLI to include Alt+Enter in the default editor.insert_newline bindings. The current workaround of using the /keymap command to remap keys does not seem to work in the VS Code integrated terminal.

Recommendation

Apply a workaround by manually adding Alt+Enter to the default editor.insert_newline bindings if possible, as upgrading to a fixed version is not currently an option. This is because the issue appears to be with the current version's keymap changes and how they interact with the VS Code integrated terminal.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Regression: Alt+Enter no longer inserts newline in VS Code WSL terminal [3 comments, 3 participants]