[BUG] Cannot swap Enter and Shift+Enter behaviors

Resolved 💬 3 comments Opened Apr 8, 2026 by cscalfani Closed Apr 12, 2026

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?

iTerm2, v2.1.96,
keybindings for context: "Chat" to SWAP enter and shift+enter: enter: chat:newline and shift+enter: chat:submit in keybindings.json

Enter does newline but also submits, Shift+Enter does newline and doesn't submit.

What Should Happen?

Enter should insert newline and Shift+Enter should submit

Error Messages/Logs

Steps to Reproduce

Environment

  • Claude Code v2.1.96
  • macOS, iTerm2
  • No custom iTerm2 key bindings
  • "Report keys using CSI u" unchecked

Config (~/.claude/keybindings.json)

Added to the Chat context:

"enter": "chat:newline",
"shift+enter": "chat:submit"

Steps to Reproduce

  1. Launch Claude Code in iTerm2
  2. Type some text
  3. Press Enter

Expected

Newline inserted, message not submitted

Actual

Newline inserted AND message submitted (hardcoded submit fires alongside the custom binding)

  1. Type some text
  2. Press Shift+Enter

Expected

Message submitted

Actual

Newline inserted (default behavior, custom binding ignored)

Summary

enter: chat:newline partially works (inserts newline) but cannot suppress the built-in submit action. shift+enter: chat:submit has no effect — Shift+Enter continues to insert a newline as if the binding were not present.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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