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

Resolved 💬 14 comments Opened Apr 30, 2026 by rafael-agenticca Closed May 1, 2026
💡 Likely answer: A maintainer (fcoury-oai, contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

14 Comments

fcoury-oai contributor · 2 months ago

@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!

rafael-agenticca · 2 months ago

@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.

NickSdot · 2 months ago

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

garyfpga · 2 months ago
@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

gh640 · 2 months ago

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!

``toml [tui.keymap.editor] insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"] ``
fcoury-oai contributor · 2 months ago
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.

therealmarrakesh · 2 months ago
[tui.keymap.editor]
insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"]

I can confirm that this fix does 'not' work for the newline insertion issue I've been having in the Zed integrated terminal. As I said in #20555:

This issue is about Shift+Enter in Zed being reported as LF / U+000A, which corresponds to Ctrl+J in C0 control-code terms. Ctrl+J is already included in the default editor.insert_newline bindings, but U+000A is not normalized to Ctrl+J in key_hint.rs, so the existing binding does not match.
erykwieliczko · 2 months ago
[tui.keymap.editor]
insert_newline = ["ctrl-j", "ctrl-m", "enter", "shift-enter", "alt-enter"]

insert_newline fixed it on Konsole.

lgc653 · 2 months ago

I can reproduce a similar regression on Windows with the Zed integrated terminal.

For me:

  • Codex 0.125.x: Shift+Enter inserted a new line in Zed
  • Codex 0.128.x: Shift+Enter no longer inserts a new line in Zed
  • In my environment, Ctrl+J also does not insert a new line in Zed, even when configured to be passed through.
  • Windows Terminal on the same machine still works with Codex 0.128.x.

So this does not seem to be limited to macOS. In my case, it looks like a terminal-specific key handling regression or compatibility issue exposed by the newer TUI keyboard handling.

therealmarrakesh · 2 months ago
So this does not seem to be limited to macOS. In my case, it looks like a terminal-specific key handling regression or compatibility issue exposed by the newer TUI keyboard handling.

Yes. Both Shift+Enter and Ctrl+J produce the C0 control character U+000A in the Zed integrated terminal. I tested both.

The input normalization helper in key_hint.rs is missing a case to normalize U+000A to Some('j'):

fn c0_control_char_to_ctrl_char(ch: char) -> Option<char> {
    match ch {
        '\u{0002}' => Some('b'),
        '\u{0006}' => Some('f'),
        '\u{000e}' => Some('n'),
        '\u{0010}' => Some('p'),
        '\u{0012}' => Some('r'),
        '\u{0013}' => Some('s'),
        _ => None,
    }
}

Adding the one line would be enough to fix this, I think:

'\u{000a}' => Some('j'),
misrtjakub · 2 months ago

I have a small patch ready for the Zed/Ctrl+J path discussed above, but GitHub is currently showing that PR creation is limited to repository collaborators:

https://github.com/openai/codex/compare/main...misrtjakub:fix/codex-shift-enter-newline?expand=1

It adds the \u{000a} -> j normalization in key_hint.rs with a focused unit test. If issue-linked compare branches are an acceptable external contribution path, this should cover the C0 LF case from #20555.

therealmarrakesh · 2 months ago
I have a small patch ready for the Zed/Ctrl+J path discussed above, but GitHub is currently showing that PR creation is limited to repository collaborators: https://github.com/openai/codex/compare/main...misrtjakub:fix/codex-shift-enter-newline?expand=1 It adds the \u{000a} -> j normalization in key_hint.rs with a focused unit test. If issue-linked compare branches are an acceptable external contribution path, this should cover the C0 LF case from #20555.

I proposed the same fix. I guess we'll see how things work out when 0.129.0 gets released.

Edit: Looks like there will be a proper fix!

fcoury-oai contributor · 2 months ago

I appreciate the proposal, we have addressed all the C0 normalizations as part of this PR that is still being reviewed:

https://github.com/openai/codex/pull/20798

therealmarrakesh · 2 months ago
I appreciate the proposal, we have addressed all the C0 normalizations as part of this PR that is still being reviewed: #20798

That's great news. Thanks.