Rebinding Enter to chat:newline still triggers submit

Resolved 💬 3 comments Opened Mar 14, 2026 by mstrandgren Closed Mar 18, 2026

Description

When rebinding Enter to chat:newline in ~/.claude/keybindings.json, pressing Enter inserts a newline but then also triggers a submit — without clearing the prompt. The expected behavior is that Enter should only insert a newline, with no submit.

Keybindings config

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

Expected behavior

Pressing Enter inserts a newline. Message is not submitted.

Actual behavior

Pressing Enter inserts a newline and submits the message. The prompt is not cleared after submission (unlike a normal submit).

Environment

  • macOS (Darwin 25.3.0)
  • Tested in both Ghostty and Terminal.app — same behavior in both
  • Claude Code latest

Notes

The keybindings documentation states that custom bindings fully replace defaults, so enter: chat:newline should suppress the default enter: chat:submit. This does not appear to be happening.

View original on GitHub ↗

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