Skip to content

Regression: Alt+Enter no longer inserts newline in VS Code WSL terminal #20501

Closed

Description

@rafael-agenticca

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.

Activity

  1. added
    bug
    on Apr 30, 2026
  2. added
    CLI
    windows-os
    TUI
    on Apr 30, 2026
  3. removed
    CLI
    on Apr 30, 2026
  4. fcoury-oai commented on Apr 30, 2026

    @fcoury-oai
    Contributor

    @rafael-agenticca this is a true regression. Can you add this to your ~/.codex/config.toml until 0.129.0 is released:

    [tui.keymap.editor]
    insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"]

    And let me know if it works for you.

    Thank you for reporting!

  5. rafael-agenticca commented on Apr 30, 2026

    @rafael-agenticca
    Author

    @fcoury-oai thanks for confirming.

    Unfortunately I won’t be able to test this reliably anymore because I already worked around the issue in my local environment. I removed/remapped the VS Code shortcuts that were intercepting Alt+Enter, so the original failure no longer reproduces for me here.

    That said, it would be useful if someone else who is still experiencing the issue could test the proposed config workaround:

    [tui.keymap.editor]
    insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"]

    This would help confirm whether the issue can be resolved only by adding alt-enter to ~/.codex/config.toml, without changing VS Code keybindings.

    Thanks again for looking into it.

  6. NickSdot commented on May 1, 2026

    @NickSdot

    +1, macOS, Apple Terminal, codex-cli 0.128.0. Had to manually re-add key bindings for "alt-enter".

  7. garyfpga commented on May 1, 2026

    @garyfpga

    @rafael-agenticca this is a true regression. Can you add this to your ~/.codex/config.toml until 0.129.0 is released:

    [tui.keymap.editor]
    insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"]
    And let me know if it works for you.

    Thank you for reporting!

    I confrim this fix is working

  8. gh640 commented on May 1, 2026

    @gh640

    I also bumped into this issue while using Codex CLI 0.128.0 on macOS. I was able to temporarily fix it with the keymap settings @fcoury-oai shared ↓ . Thanks!

    [tui.keymap.editor]
    insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"]
  9. fcoury-oai commented on May 1, 2026

    @fcoury-oai
    Contributor

    I also bumped into this issue while using Codex CLI 0.128.0 on macOS. I was able to temporarily fix it with the keymap settings @fcoury-oai shared ↓ . Thanks!

    Thanks for confirming it works for you, this way we can reference this issue until we have the fix out.

  10. added
    regression
    on May 1, 2026
  11. 14 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbugregressionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions