[BUG] Shift enter sends new message, instead of adding newline
Status Closed — not planned
Reported on v2.1.49
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 13 comments · opened Feb 21, 2026 · closed May 5, 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?
Shift enter sends new message, instead of adding newline
bug in v2.1.50, works in .49
What Should Happen?
Newline
Error Messages/Logs
n/a
Steps to Reproduce
Try to use shift + enter, sends message
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.49
Claude Code Version
2.1.50
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
2026-02-24 Still occurring in Claude Code 2.1.52 on Windows. [CTRL]+[ENTER] does work (for me).
Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.
What's happening: A regression introduced in Claude Code v2.1.50 broke the Shift+Enter keybinding behavior. The keyboard input handling was changed so that Shift+Enter now triggers message submission (same as Enter) instead of inserting a newline character into the input buffer. This is likely caused by a change in the key event handler that either removed the Shift modifier check before submitting, or altered the keybinding map so Shift+Enter no longer maps to the 'newline' action. The bug is specific to the terminal input layer (Ink/React-based TUI) where key events are processed.
What worked for us:
The Shift+Enter key combination handler in the terminal input component needs to be restored to insert a newline instead of submitting the message. The key event handler should check for the Shift modifier and, when present with Enter, insert '\n' into the input buffer rather than triggering the submit action. This was working in v2.1.49 and regressed in v2.1.50, so the fix involves reverting or correcting the key handling logic that changed between those versions.
Steps:
📊 _We found 4 similar cases in our knowledge base with the same pattern — this gives us high confidence in this analysis._
Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞
---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>
2026-03-04 Still occurring in Claude Code 2.1.68 on Windows. [CTRL]+[ENTER] does work (for me).
Workaround: Shift+Enter for newline in Claude Code on Windows Terminal
Verified working on:
The root cause is that Windows Terminal sends the same byte (CR) for both Enter and Shift+Enter — the terminal can't distinguish them. The fix requires two changes:
1. Windows Terminal — teach it to send a distinct escape sequence for Shift+Enter
In
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json, add toactions:And add to
keybindings:2. Claude Code — map Shift+Enter to newline
In
~/.claude/keybindings.json:Restart Windows Terminal after both changes. Shift+Enter will insert a newline, Enter will send — matching Claude.ai and Claude Desktop behavior.
Still broken
Update: removed my keybinding json and did /terminal-setup now works again.
This was exactly my problem. It seems claude code changed the newline command, from
"\\\r\n"to"\^[\r", but didn't migrate existing installs correctly.Same issue on Windows Terminal. A terminal-side workaround (configuring sendInput with Kitty escape sequence \^[[13;2u for shift+enter) works for Claude Code, but breaks other CLI tools (e.g. Codex CLI which doesn't support the Kitty keyboard protocol). Claude Code should opt-in to the Kitty keyboard protocol itself.
Adding evidence that this may also affect clean installs, not just users with stale keybinding configs:
Background
I tested this both in my normal macOS and in a clean macOS user account (latter with only Claude Code installed, no custom shell config)
Repro 1: fresh terminal
zsh -f(meaning no rc files, no plugins, bare shell)claudeRepro 2: clean macOS user account w/ nothing installed except Claude Code:
claudeexitclaudeagain in the same window no config changeObservations
Running cd/ls between launches doesn't appear to fix the problem. Only a prior claude session does. That points to a race condition in the Kitty protocol handshake rather than shell warmup. The first session appears to leave the terminal in Kitty protocol mode, second inherits it.
This method worked for me. Thank you so much.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.