claude-code - 💡(How to fix) Fix Keybinding: cannot override default 'enter → chat:submit' with user bindings

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

User keybindings cannot override the default enter → chat:submit binding. When a user adds \"enter\": \"chat:newline\" to their ~/.claude/keybindings.json, Enter still submits the chat instead of inserting a newline.

Root Cause

User keybindings cannot override the default enter → chat:submit binding. When a user adds \"enter\": \"chat:newline\" to their ~/.claude/keybindings.json, Enter still submits the chat instead of inserting a newline.

Code Example

{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "enter": "chat:newline",
        "ctrl+enter": "chat:submit"
      }
    }
  ]
}
RAW_BUFFERClick to expand / collapse

Summary

User keybindings cannot override the default enter → chat:submit binding. When a user adds \"enter\": \"chat:newline\" to their ~/.claude/keybindings.json, Enter still submits the chat instead of inserting a newline.

Expected behaviour

Per the keybindings documentation, user bindings should be able to rebind enter to chat:newline, making Enter insert a newline and a separate key (e.g. ctrl+enter or alt+enter) submit the message.

Actual behaviour

Enter continues to submit regardless of what is set in keybindings.json. The default enter → chat:submit binding always takes precedence.

Reproduction steps

  1. Add the following to ~/.claude/keybindings.json:
{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "enter": "chat:newline",
        "ctrl+enter": "chat:submit"
      }
    }
  ]
}
  1. Restart Claude Code desktop app
  2. Press Enter in the chat input

Result: Message is submitted
Expected: A newline is inserted

Additional context

  • Also attempted: splitting into two context blocks (first block enter: null to unbind default, second block enter: "chat:newline" to rebind) — Enter still submits
  • Also attempted: alt+enter for submit — Enter still submits regardless of submit key
  • The docs state user bindings are "additive" and "appended after defaults" — this appears to mean defaults always win when the same key is used, with no way for users to override them
  • Platform: Windows, Claude Code desktop app v2.1.132

Suggested fix

Either:

  • Allow user bindings to override defaults when the same key is specified (last-binding-wins), or
  • Document that enter cannot be rebound and suggest ctrl+j (the default newline key) as the alternative

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Keybinding: cannot override default 'enter → chat:submit' with user bindings