[BUG] Cannot swap Enter and Shift+Enter behaviors
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
- Launch Claude Code in iTerm2
- Type some text
- Press Enter
Expected
Newline inserted, message not submitted
Actual
Newline inserted AND message submitted (hardcoded submit fires alongside the custom binding)
- Type some text
- 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_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗