Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.157.1 (native Windows executable).
What platform is your computer?
Windows 11 Pro x64, build 26200.
What terminal emulator and version are you using?
Windows Terminal 1.24.11911.0, running PowerShell 7.6.6.
What issue are you seeing?
Pressing Shift+Enter inserts literal [13;2u into the composer instead of a newline. Repeated presses produce repeated fragments:
[13;2u[13;2u[13;2u
The reproduction depends on an explicit Windows Terminal sendInput mapping. Ctrl+J successfully inserts a newline on the same installation.
What steps can reproduce the bug?
The relevant Windows Terminal settings.json entries are:
{
"actions": [
{
"command": {
"action": "sendInput",
"input": "\u001b[13;2u"
},
"id": "User.sendInput.ShiftEnterCustom"
}
],
"keybindings": [
{
"keys": "shift+enter",
"id": "User.sendInput.ShiftEnterCustom"
}
]
}These are excerpts to merge into the existing arrays, not a replacement for the whole settings file.
- Use the Shift+Enter mapping above in Windows Terminal.
- Start native Windows
codex. - Type
first line, then press Shift+Enter several times. - Observe
[13;2ufragments instead of line breaks. - Press Ctrl+J and observe that it correctly inserts a newline.
The mapping was inspected locally, and both the Shift+Enter failure and Ctrl+J success were manually confirmed. The failure occurs while composing a message, before submission.
What is the expected behavior?
The mapped Shift+Enter sequence should insert a newline without submitting the message or inserting protocol text. Ordinary Enter submission and literal pasted text should remain intact.
Additional information
This configuration matches OpenCode's documented Windows Terminal mapping. OpenCode CLI 2.0.15 handles Shift+Enter successfully with the same terminal configuration in my normal use.
Related history: #4401 described the same literal output but is closed. This report isolates the explicit CSI-u mapping on current native Windows Codex. Please include that mapping when reproducing; unmodified native Shift+Enter exercises a different input route.
Separately, Ctrl+Enter briefly pauses the blinking cursor. That pause has not been timed or traced. Ctrl+J and Ctrl+Alt+V both work, so this observation does not establish a general Ctrl-key failure.
Version-pinned source observations
Codex already defines Shift+Enter as a newline binding in the 0.157.1 keymap.
The terminal mapping emits a CSI-u escape sequence. Codex's Windows input setup clears ENABLE_VIRTUAL_TERMINAL_INPUT, and its event source reasserts console input-record mode.
The pinned Crossterm fork's Windows event source reads individual console input records. Its Windows key parser maps virtual keys/characters; this path does not assemble a CSI-u sequence into a modified Enter event.
These observations are consistent with the failure. No native event trace or automated input replay has been captured, so the exact console translation of every input character is not established. The two Codex input-mode files were also unchanged at inspected main commit 67a709665ac7b50311b93e32612c9a8281684787.
A fix should handle the sequence at the input boundary and preserve standalone Escape, ordinary native key events, fragmented input, and pasted literal text containing [13;2u.
Activity
etraut-openai commentedon Oct 2, 2026
(response from codex)
Confirmed. Windows Terminal emits the configured CSI-u sequence as Win32 input records, but the Crossterm Windows parser drops the VK-zero Escape record. Codex therefore receives only
[13;2uas printable input.This is an upstream Crossterm issue. Handling the bare suffix in Codex would risk corrupting legitimate pasted text, so we do not plan to work around it here. Revisit if Crossterm preserves the Escape record or Codex updates its Windows input backend.
etraut-openai commentedon Oct 12, 2026
(response from codex)
Closing as fixed by #50720, included in CLI v0.162.1. Windows Terminal's mapped Shift+Enter sequence is now decoded as a modified Enter instead of inserting [13;2u text, so the newline binding works.