Skip to content

Shift+Enter does not work in Codex inside tmux #16121

Closed as not planned
Closed as not planned

Description

@antonme

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:

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.

Activity

  1. added
    bug
    on Mar 28, 2026
  2. added
    CLI
    TUI
    on Mar 28, 2026
  3. github-actions commented on Mar 28, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. etraut-openai commented on Mar 28, 2026

    @etraut-openai
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions