`chat:newline` keybinding does not work when bound to `enter` key

Resolved 💬 2 comments Opened Feb 19, 2026 by shiryu2002 Closed Feb 19, 2026

Environment

  • Claude Code: 2.1.47
  • OS: WSL2 (Windows Terminal / VSCode Terminal)
  • Terminal Multiplexer: Zellij

Description

In v2.1.47, chat:newline was added as a keybinding action (#26075). However, binding it to the enter key does not work — pressing Enter still triggers chat:submit instead of inserting a newline.

Steps to Reproduce

  1. Add the following to ~/.claude/keybindings.json:
{
  "context": "Chat",
  "bindings": {
    "enter": "chat:newline",
    "ctrl+enter": "chat:submit"
  }
}
  1. Restart Claude Code
  2. Press Enter in the chat input

Expected: A newline is inserted
Actual: The message is submitted

What I tried

  • Setting "enter": null in a separate Chat context block before rebinding → same result (also related to #22626)
  • Directly setting "enter": "chat:newline" without null → same result
  • Restarting Claude Code after each change → no effect

Analysis

In terminals, the Enter key sends CR (0x0D), which is identical to ctrl+m. Since ctrl+m is documented as non-rebindable ("identical to Enter in terminals, both send CR"), it appears that the hardcoded CR → submit behavior takes precedence over the user keybinding, making it impossible to remap enter to chat:newline.

This means chat:newline can only be assigned to modifier keys like shift+enter or alt+enter, but not to plain enter — which limits the usefulness of this feature for users who want the common "Enter = newline, Ctrl+Enter = submit" pattern used in Slack, Discord, etc.

Request

Allow enter to be rebound to chat:newline by having the keybinding layer intercept CR before the hardcoded submit logic.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗