Regression: Alt+Enter no longer inserts newline in VS Code WSL terminal
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?
- Open VS Code connected to WSL.
- Open the VS Code integrated terminal.
- Run
codex. - Confirm the version is
codex-cli 0.128.0. - Type text in the composer.
- Press Alt+Enter.
- Observe that a newline is not inserted.
Optional:
- Open
/keymap. - Try mapping
editor.insert_newlineto Ctrl+Alt+J or Ctrl+Alt+X. - Return to the composer.
- Press the configured key combination.
- 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.
14 Comments
@rafael-agenticca this is a true regression. Can you add this to your
~/.codex/config.tomluntil 0.129.0 is released:And let me know if it works for you.
Thank you for reporting!
@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:
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.
+1, macOS, Apple Terminal, codex-cli 0.128.0. Had to manually re-add key bindings for "alt-enter".
I confrim this fix is working
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.
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:insert_newlinefixed it onKonsole.I can reproduce a similar regression on Windows with the Zed integrated terminal.
For me:
Shift+Enterinserted a new line in ZedShift+Enterno longer inserts a new line in ZedCtrl+Jalso does not insert a new line in Zed, even when configured to be passed through.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+EnterandCtrl+Jproduce the C0 control characterU+000Ain the Zed integrated terminal. I tested both.The input normalization helper in
key_hint.rsis missing a case to normalizeU+000AtoSome('j'):Adding the one line would be enough to fix this, I think:
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}->jnormalization inkey_hint.rswith 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.0gets released.Edit: Looks like there will be a proper fix!
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
That's great news. Thanks.