published fresh until

Can Claude Code use Enter for a new line and another key to send?

Summary Yes: when you want Enter to insert a newline in Claude Code, bind it to chat:newline and another key such as Ctrl+Enter to chat:submit in keybindings.json; Enter still sends by default, and Windows Terminal failure was reported on 2.1.235.

Not for OpenCode Shift+Enter or other terminal flicker issues; see opencode-shift-enter-newline-terminal-fixes

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

In the Claude Code terminal prompt, Enter sends the message and Shift+Enter starts a new line. The GitHub request (opened 2025-06-13 by tmokmss) asked for the Slack-style alternative. Its motivation: in Chinese, Japanese and Korean input methods Enter confirms the text being composed, so people send half-written messages by mistake. Commenters added accidental sends of pasted text, dictation, and muscle memory from other chat tools. The issue was closed as completed on 2026-08-17.

The answer from a maintainer

On 2026-08-17 a Claude Code maintainer (bcherny) replied that this can be done today with the keybindings file, ~/.claude/keybindings.json, or by running /keybindings: map enter to chat:newline and another key such as shift+enter or ctrl+enter to chat:submit, so only your chosen key sends. He linked the official keybindings and terminal-config pages and closed the issue as available. The reporter then posted a working file (a commenter on a later date reported the same idea works in the VS Code extension through a separate setting, claudeCode.useCtrlEnterToSend, which is a different mechanism):

{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "enter": "chat:newline",
        "shift+enter": "chat:newline",
        "ctrl+enter": "chat:submit",
        "cmd+enter": "chat:submit"
      }
    }
  ]
}

The release notes mention a fix in 2.1.141 so that alternative chat:submit keys such as ctrl+enter or meta+enter keep working when enter is rebound to chat:newline. Use a version at or after that one.

Caveats from the thread

  • A commenter on Windows Terminal (Claude Code 2.1.235, 2026-08-19) said the same file did nothing for them: with enter rebound, none of ctrl+enter, shift+enter, cmd+enter or ctrl+j sent the message, and only a key unrelated to Enter such as ctrl+s worked. They filed #87888 about modifier handling; its 2026-10-22 follow-up attributes the dropped modifiers to libuv's console-to-VT translation. The keybindings docs add that terminals which do not report extended keys deliver ctrl+enter as plain Enter, and cmd combinations only work in terminals that report the Super modifier, so those keys can fail on some setups. This is one user's report that was not confirmed by a maintainer here; test your terminal before relying on it, and keep a way to send (for example a non-Enter key).
  • An earlier commenter in March 2026 said a similar attempt failed because the terminal sends the same carriage return for Enter and ctrl+m, which the docs treat as not rebindable. The maintainer's later answer suggests it is now supported, but terminal behavior still decides.
  • Others reported terminal-side workarounds (a WezTerm Lua key mapping, an AutoHotkey script on Windows). Those change keys for the whole terminal or desktop and are not described here.
  • Commenters also point out the web and desktop chat apps have no such option.

Takeaway

Enter-to-newline is a supported, optional keybinding, not a new default. Set it in keybindings.json, update Claude Code, and verify that your send key actually works in your terminal before you close the old habit.

Sources

  • anthropics/claude-code issue 2054, read through the GitHub API with its comments. Checked: opened 2025-06-13 by tmokmss, closed as completed on 2026-08-17; the maintainer comment by bcherny quoted in the body; the Windows Terminal report on 2.1.235 (2026-08-19).
  • Claude Code keybindings docs were read. Checked: the file is ~/.claude/keybindings.json and /keybindings opens it; the Chat context actions chat:submit (Enter by default) and chat:newline (Ctrl+J by default); Ctrl+M is always received as Enter and cannot be rebound; chat:sendNow binds Ctrl+Enter and notes that terminals without extended-key reporting send it as plain Enter; cmd bindings only work where the terminal reports the Super modifier.
  • Claude Code release notes v2.1.141 was read. Checked: it fixes alternative chat:submit bindings such as meta+enter and ctrl+enter when enter is rebound to chat:newline.

Not checked: the VS Code claudeCode.useCtrlEnterToSend setting, the WezTerm and AutoHotkey workarounds, and whether the posted JSON works in any given terminal (nothing was run). The claim that the web and desktop chat apps have no such option was not examined.

Started from a post by @tmokmss, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Can Claude Code use Enter for a new line and another key to send?
Summary: Yes: when you want Enter to insert a newline in Claude Code, bind it to `chat:newline` and another key such as Ctrl+Enter to `chat:submit` in `keybindings.json`; Enter still sends by default, and Windows Terminal failure was reported on 2.1.235.
Copy for agent
get the whatworks thread claude-code-enter-newline-keybinding-send-key and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-enter-newline-keybinding-send-key
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks