[BUG] chat:newline keybinding submits message when input has text

Open 💬 12 comments Opened Feb 20, 2026 by ww2283

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Remapping enter to chat:newline in ~/.claude/keybindings.json does not fully work when the input contains text.

## Keybindings config

```json
{
"context": "Chat",
"bindings": {
"shift+enter": "chat:submit",
"enter": "chat:newline"
}
}

What Should Happen?

Pressing Enter always inserts a newline, regardless of whether the input is empty or contains text.

Error Messages/Logs

Steps to Reproduce

## Keybindings config

  {                                                                                                                                   
    "context": "Chat",                                                                                                                
    "bindings": {                                                                                                                     
      "shift+enter": "chat:submit",                                                                                                   
      "enter": "chat:newline"                                                                                                         
    }                                                                                                                                 
  }

Expected behavior

Pressing Enter always inserts a newline, regardless of whether the input is empty or contains text.

Actual behavior

  • Empty input: Enter correctly inserts a newline.
  • Input with text: Enter submits the message AND leaves a duplicate copy of the text in the input field (as if attempting both

newline and submit simultaneously).

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.49

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Environment

  • macOS (Darwin 24.6.0)
  • Tested in both VS Code integrated terminal and iTerm2 — same behavior in both
  • Claude Code CLI (latest)

Notes

  • Option+Enter (default macOS multiline shortcut) works correctly in all cases
  • The keybinding is being recognized (the duplicate text left in the input suggests partial newline behavior), but submit is not

fully suppressed

View original on GitHub ↗

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