Codex CLI does not recognize Shift+Enter modifyOtherKeys sequence inside GNU screen

Open 💬 0 comments Opened Jul 3, 2026 by xjtushilei

What version of Codex CLI is running?

codex-cli 0.142.4

What subscription do you have?

Not provided

Which model were you using?

Not model-specific; this is a TUI input handling issue.

What platform is your computer?

Affected remote host details not provided yet. The issue was observed over SSH inside GNU screen.

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

Remote SSH session inside GNU screen.

Shift+Enter raw bytes delivered inside the screen session:

\x1b[27;2;13~

Hex:

1b 5b 32 37 3b 32 3b 31 33 7e

Codex doctor report

Not available yet. The issue can be reproduced from /keymap debug plus the raw input test below.

What issue are you seeing?

When Codex CLI runs inside a remote GNU screen session, Shift+Enter and Option+Enter cannot be used to insert a newline in the composer.

In /keymap debug, pressing Shift+Enter produces no detected key event.

However, the same screen session does deliver bytes for Shift+Enter. A raw terminal input test shows:

b'\x1b'
b'['
b'2'
b'7'
b';'
b'2'
b';'
b'1'
b'3'
b'~'

Combined, that is:

\x1b[27;2;13~

This appears to be the xterm modifyOtherKeys style sequence for Shift+Enter (13 = Enter, modifier 2 = Shift). Claude Code in the same screen environment recognizes the key combination and can insert a newline, but Codex CLI does not.

Ctrl+J is detected by Codex and can be used as a workaround when bound to tui.keymap.editor.insert_newline.

This is related to GNU screen compatibility, but distinct from #29598. That issue is about repeated BEL/beep behavior from title updates; this issue is about Codex not decoding a delivered keyboard input sequence.

What steps can reproduce the bug?

  1. SSH into a remote host and start a GNU screen session.
  2. Run codex.
  3. Open /keymap debug.
  4. Press Shift+Enter.
  5. Observe that Codex reports no detected key event.
  6. In the same screen session, run a raw input test:
python3 -c 'import sys,tty; tty.setraw(sys.stdin.fileno()); print("press keys, ctrl-c exit"); [print(repr(sys.stdin.buffer.read(1))) for _ in iter(int,1)]'
  1. Press Shift+Enter in that raw input test.
  2. Observe that the terminal delivers \x1b[27;2;13~.

View original on GitHub ↗