Shift+Enter does not work in Codex inside tmux

Resolved 💬 2 comments Opened Mar 28, 2026 by antonme Closed Mar 28, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.117.0

What subscription do you have?

Business/Team

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin 25.3.0 arm64 arm

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

Ghostty

What issue are you seeing?

Shift+Enter does not insert a newline in Codex when Codex is running inside tmux.

The same Shift+Enter shortcut works:

  • in Codex outside tmux over the same SSH connection
  • in other apps inside the same tmux session, including fish and Claude

So this appears to be specific to Codex running under tmux, not a general terminal or tmux key handling problem.

What steps can reproduce the bug?

  1. SSH into a remote machine.
  2. Start a tmux session.
  3. Launch Codex inside tmux.
  4. Focus the prompt input and press Shift+Enter.

I also verified tmux extended keys are enabled:
```tmux
set -s extended-keys on
set -s extended-keys-format csi-u
set -as terminal-features ",xterm-256color:extkeys"


 After reloading and reattaching, tmux reports:

 - version: 3.6a
 - client term: xterm-256color
 - client features: bpaste,ccolour,clipboard,cstyle,extkeys,focus,RGB,title
 - default terminal: tmux-256color

### What is the expected behavior?

Shift+Enter should insert a newline in Codex inside tmux, the same way it does when Codex is run outside tmux.

### Additional information

This is reproducible specifically in the ssh -> tmux -> Codex path.

In my setup:
-   ssh -> Codex: Shift+Enter works
-   ssh -> tmux -> Codex: Shift+Enter does not work
-   inside the same tmux session, Shift+Enter still works in fish and Claude

That suggests Codex is not recognizing the key sequence it receives under tmux, even when tmux extended key support is enabled.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #14570
  • #15682

Powered by Codex Action

etraut-openai contributor · 5 months ago

This is a terminal configuration issue. Codex supports Ctrl+J as the standard keyboard binding for inserting a new line. Most terminal emulators provide ways to configure the behavior of Shift+Enter. You can map it to Ctrl+J if you want.