Skip to content

Make ENTER insert newline in Codex TUI input (send on Ctrl+Enter instead) #12129

@smileBeda

Description

@smileBeda

What variant of Codex are you using?

CLI

What feature would you like to see?

Summary

Currently, the Codex CLI/TUI sends the prompt on ENTER and inserts a newline on Ctrl + J. While this matches traditional terminal behavior, the Codex TUI functions primarily as a multiline prompt editor rather than a classic shell.

This keybinding choice conflicts with modern text-editing conventions and frequently leads to accidental submission of incomplete prompts.


Problem

In most contemporary tools (IDEs, chat interfaces, documentation tools, browsers, etc.):

  • ENTER inserts a newline
  • Ctrl + Enter submits content (or, alternatively, CMD + Enter)

The Codex TUI reverses this expectation:

  • ENTER submits
  • Ctrl + J inserts newline

This creates several usability issues:

  • Strong mismatch with established typing muscle memory
  • Frequent accidental submission of unfinished prompts
  • Cognitive friction when switching between Codex and other tools
  • Ctrl + J is non-standard and unintuitive for multiline entry

In practice, this results in a high rate of unintended prompt submission.


Proposed Change

Adopt a text-editor-oriented interaction model:

  • ENTER → Insert newline
  • Ctrl + Enter or CMD + Enter → Submit prompt

Alternatively, and MUCH BETTER - make this configurable:

  • Terminal-style mode (current behavior)
  • Editor-style mode (proposed behavior)
  • Define custom bindings (let user choose their combinations)

Rationale

The Codex TUI operates more like a structured prompt composition interface than a traditional command shell. Aligning keybindings with modern editor conventions would:

  • Reduce accidental submissions
  • Improve workflow consistency
  • Lower cognitive load
  • Better match user expectations in AI prompt composition contexts

This change would improve usability without affecting core functionality.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions