chat:newline action re-inserts entire input buffer instead of inserting newline

Resolved 💬 3 comments Opened Apr 3, 2026 by federerb Closed Apr 3, 2026

Description

When binding enter to chat:newline in ~/.claude/keybindings.json, pressing Enter re-inserts the entire prompt content above the cursor instead of inserting a single newline character. This makes it impossible to use Enter for newlines and Cmd+Enter for submit.

Steps to Reproduce

  1. Create ~/.claude/keybindings.json with:
{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "enter": null,
        "cmd+enter": "chat:submit"
      }
    },
    {
      "context": "Chat",
      "bindings": {
        "enter": "chat:newline"
      }
    }
  ]
}
  1. Type some text in the chat input
  2. Press Enter

Expected Behavior

A newline character is inserted at the cursor position.

Actual Behavior

The entire current input buffer content is re-inserted above the cursor, duplicating all text.

Environment

  • Claude Code version: 2.1.91
  • OS: macOS (Darwin 22.6.0)

Workaround

Use Ctrl+G or Ctrl+X Ctrl+E to open an external editor for multi-line input.

View original on GitHub ↗

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