TL;DR
- Enable the Kitty keyboard protocol on your terminal (WezTerm: add
config.enable_kitty_keyboard = true
to yourwezterm.lua
) - Open a new terminal window
If you've been using Claude Code and noticed that Shift+Enter simply sends your message instead of adding a new line, you're not imagining things; It doesn't really work right away. The good news is that it's actually a one-part solution, and once you know why it doesn't work, it makes a lot of sense.
Why doesn't it work?
Claude Code supports a chat: new line
action, but the reason Shift+Enter doesn't fire is because of how your terminal handles key input.
Most terminals, by default, send exactly the same sequence of bytes for both Enter and Shift+Enter. That means that although Claude Code is perfectly capable of inserting a new line, your terminal never tells you that Shift+Enter was pressed; just go Enter and submit.
This is a known limitation of the traditional XTerm key encryption that most terminals use. The solution is to enable a newer keyboard protocol that can distinguish between modified keys.
The solution
Step 1 – Enable Extended Key Reporting on Your Terminal
This step depends on the terminal you are using. The key thing you need is support for the Kitty keyboard protocol.
If you've heard of the Kitty Image Protocol (which allows terminals to display images online), 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 as the Image Protocol adds capabilities that the original terminal specification never had, the Kitty Keyboard Protocol adds the ability to send distinct escape sequences for key combinations that classic XTerm coding cannot distinguish, such as Shift+Enter vs Enter.
So even if you don't use Kitty as a terminal, you can still benefit from the protocol she introduced. Most modern terminals have added support for this.
WezTerm (this is the terminal I use and tested):
Add this to your ~/.config/wezterm/wezterm.lua
(or wherever your setup lives):
config.enable_kitty_keyboard = true
Other endpoints that support extended key reporting:
- Kitty: enabled by default
- Ghostty: enabled by default
- iTerm2: enable "CSI u" mode in Preferences → Profiles → Keys
If you are on a terminal that does not support any of these protocols, Shift+Enter may not work without switching terminals.
Step 2: Open a new terminal window
This is the step that is easy to miss. The keyboard protocol is negotiated when a terminal session is started, so reloading the configuration is not enough. You must 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 expected.
Conclusion
The Claude Code team may add better handling for endpoints that don't support extended key reporting in the future, which would make this post completely unnecessary. If that happens this post will get really old and honestly that would be great. But for now, these are the obstacles you need to overcome to make it work.