Skip to content

Config option that swaps the default Enter key behavior: Enter inserts newline, Ctrl+Enter submits input #5716

Closed

Description

@hackf5

What feature would you like to see?

Currently, pressing Enter submits the input, while Ctrl+Enter inserts a newline.
This setup optimises for single-line use, but many workflows involve multi-line input by default. Accidental early submissions are frequent and frustrating.

Proposed Enhancement

Add a new config option that swaps the default behavior:

  • Enter → insert newline
  • Ctrl+Enter → submit input

Additional information

No response

Activity

  1. added
    enhancement
    on Oct 26, 2025
  2. github-actions commented on Oct 26, 2025

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. mafiozydev commented on Nov 2, 2025

    @mafiozydev

    same. Using codex for one week. And i was speechless when discovered after last update that there is no more inserting trough enter and you cannot return it back. So, now i have ctrl+enter and enter that are sending messages :)))))) and you cannot reset it somewhere. just... i dont know.. wanna break my keyboard

  4. added
    TUI
    on Nov 15, 2025
  5. PaulRudin commented on Dec 6, 2025

    @PaulRudin

    The keybinds for this kind of thing just need to be configurable - some fix set of presets is always going to be inconvenient for some users.

  6. PowerSix commented on Jan 29, 2026

    @PowerSix
  7. gpeal commented on Jan 30, 2026

    @gpeal
  8. PowerSix commented on Feb 1, 2026

    @PowerSix

    This setting is just a cheap way to restore the functionality that used to be a previous default. And, as you noted, it doesn't even work.
    I reported it here (#5687) but it just got ignored, like most of discussions about Codex hotkeys.

    Even this conversation we're having right here is being marked as off-topic. Devs would rather stifle this entire hotkey conversation than have people choose whether to use Enter or Ctrl+Enter for a new line.

    If they actually cared, we wouldn't have 4-month long, highly upvoted issues like this one (#3049).

  9. etraut-openai commented on Feb 1, 2026

    @etraut-openai
    Contributor

    @PowerSix, this issue is specifically about the Codex CLI (TUI). If I understand correctly, you are using the Codex IDE Extension, so this issue does not apply. That's why I hid these remarks as "off topic" to avoid confusion.

  10. fatih commented on Feb 5, 2026

    @fatih
  11. miura-htec commented on Feb 13, 2026

    @miura-htec

    +1 for this request. On macOS, I want Enter to insert a newline and Cmd+Enter to send (Ctrl+Enter on Windows/Linux). This would prevent accidental sends when writing multi-line prompts.

  12. libook commented on May 15, 2026

    @libook

    The current design seems to prevent me from manually inserting a new line; instead, I have to copy a multi-line text block from elsewhere just to use the Enter key to create a new line. A better design would be:

    1. Shortcut keys should behave consistently in all situations to reduce the cognitive load on users.
    2. Regardless of how users configure shortcut keys, the system should support both submitting and inserting a new line.
  13. etraut-openai commented on May 15, 2026

    @etraut-openai
    Contributor

    We recently added the /keymap command. It allows you to configure key bindings for all key shortcuts in the TUI.

  14. hackf5 commented on May 15, 2026

    @hackf5
    Author

    @etraut-openai, thanks that's a significant improvement. i can now bind enter to new line (need to unlearn pressing CTRL all the time)!

    A small thing: i can't bind ctrl-enter to submit. That's fine, i've bound it to ctrl-j which is mechanically equivalent. Maybe this is a WSL2 windows terminal thing.

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

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions