claude-code - 💡(How to fix) Fix Keybinding override for "enter" does not suppress default "chat:submit" action [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#45209Fetched 2026-04-09 08:10:44
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1cross-referenced ×1

When overriding enter to chat:newline in ~/.claude/keybindings.json, the default chat:submit action is not suppressed. Pressing Enter inserts a newline and submits the message simultaneously.

Root Cause

When overriding enter to chat:newline in ~/.claude/keybindings.json, the default chat:submit action is not suppressed. Pressing Enter inserts a newline and submits the message simultaneously.

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

Description

When overriding enter to chat:newline in ~/.claude/keybindings.json, the default chat:submit action is not suppressed. Pressing Enter inserts a newline and submits the message simultaneously.

Keybindings Configuration

{
  "$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"
      }
    }
  ]
}

Expected Behavior

  • Enter: inserts a newline only
  • Ctrl+Enter: submits the message

Actual Behavior

  • Enter: inserts a newline and submits the message (both actions fire)
  • Ctrl+Enter: submits the message

Environment

  • Claude Code version: 2.1.96
  • OS: macOS (Darwin 25.3.0)
  • Shell: zsh
  • Terminals tested: Warp, macOS Terminal.app (same behavior on both)

extent analysis

TL;DR

The issue can be resolved by explicitly setting the chat:submit action to a different keybinding or modifying the existing configuration to prevent both actions from firing on Enter key press.

Guidance

  • Review the keybindings configuration to ensure that the enter key is not implicitly bound to chat:submit in addition to chat:newline.
  • Consider adding an explicit null or empty binding for chat:submit when enter is pressed to suppress the default submit action.
  • Verify that the keybindings configuration is correctly loaded and applied by checking the Claude Code documentation for any specific requirements or restrictions.
  • Test the modified keybindings configuration to ensure that the expected behavior is achieved, with Enter inserting a newline only and Ctrl+Enter submitting the message.

Example

{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "enter": "chat:newline",
        "ctrl+enter": "chat:submit",
        "enter+shift": null // or an empty string to suppress default action
      }
    }
  ]
}

Note: The example above is speculative and may not be a valid solution, as the actual keybindings configuration syntax and behavior are not fully understood from the provided issue description.

Notes

The provided issue description lacks information about the underlying keybindings configuration syntax and behavior, which may limit the effectiveness of the suggested solutions. Additionally, the example code snippet is speculative and may not be a valid solution.

Recommendation

Apply a workaround by modifying the keybindings configuration to explicitly suppress the default chat:submit action when the enter key is pressed. This approach allows for a targeted fix without relying on implicit assumptions about the underlying configuration syntax and behavior.

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