TL;DR
- Enable the Kitty keyboard protocol in your terminal (WezTerm: add
config.enable_kitty_keyboard = trueto yourwezterm.lua) - Open a new terminal window
If you've been using Claude Code and noticed that Shift+Enter just submits your message instead of adding a new line, you're not imagining things — it genuinely doesn't work out of the box. The good news is it's actually a one-part fix, and once you know why it's broken, it makes total sense.
Why it doesn't work
Claude Code does support a chat:newline action, but the reason Shift+Enter doesn't trigger it comes down to how your terminal handles key input.
Most terminals, by default, send the exact same byte sequence for both Enter and Shift+Enter. That means even though Claude Code is perfectly capable of inserting a new line, your terminal never actually tells it that Shift+Enter was pressed — it just sees Enter, and submits.
This is a known limitation of the traditional XTerm key encoding that most terminals use. The fix is to enable a newer keyboard protocol that can distinguish between modified keys.
The fix
Step 1: Enable extended key reporting in your terminal
This step depends on which terminal you're using. The key thing you need is support for the Kitty keyboard protocol.
If you've heard of the Kitty image protocol (which lets terminals display inline images), it's the same idea — a set of extensions to the traditional terminal protocol, created by the Kitty terminal, that other terminals have since adopted. Just like the image protocol adds capabilities the original terminal spec never had, the Kitty keyboard protocol adds the ability to send distinct escape sequences for key combinations that classic XTerm encoding can't distinguish — like Shift+Enter vs Enter.
So even though you might not be using Kitty as your terminal, you can still benefit from the protocol it introduced. Most modern terminals have added support for it.
WezTerm (this is the terminal I use and tested with):
Add this to your ~/.config/wezterm/wezterm.lua (or wherever your config lives):
config.enable_kitty_keyboard = true
Other terminals that support extended key reporting:
- Kitty — enabled by default
- Ghostty — enabled by default
- iTerm2 — enable "CSI u" mode in Preferences → Profiles → Keys
If you're on a terminal that doesn't support any of these protocols, Shift+Enter likely can't be made to work without switching terminals.
Step 2: Open a new terminal window
This is the step that's easy to miss. The keyboard protocol is negotiated when a terminal session starts, so a config reload isn't enough. You need to open a new window (not just a new tab in the same session) for the change to take effect.
Once you do that, Shift+Enter should insert a new line exactly as you'd expect.
Conclusion
It's possible that the Claude Code team will add better handling for terminals that don't support extended key reporting in the future, which would make this post completely unnecessary. If that happens, this post will age badly — and honestly, that would be great. But for now, these are the hoops you need to jump through to get it working.
Top comments (0)