Claude Code Shift+Enter Not Working? Newline Fix by Terminal
Shift+Enter sending your Claude Code prompt instead of a newline? Fixes for VS Code, tmux and Alacritty, plus two newline keys that work in every terminal.
If Shift+Enter sends your Claude Code prompt instead of starting a new line, you have three quick options. Press Ctrl+J or type \ then Enter, both of which insert a newline in every terminal with no setup. Run /terminal-setup inside Claude Code if you are in VS Code, Cursor, Zed or an older Alacritty. And if you are inside tmux, add two extended-keys lines to ~/.tmux.conf. Most native terminals, including Ghostty, iTerm2, Kitty, WezTerm, Warp and Apple Terminal, handle Shift+Enter out of the box. Here is the fix for each case.
Few things are as quietly maddening as writing the first line of a careful, three-part prompt and watching Claude start working on half of it. It happens because many terminals send the exact same bytes for Enter and Shift+Enter, so the program inside has no way to tell them apart. The fix is always one of: use a different key, teach the terminal to send a distinct sequence, or stop something in the middle (tmux) from flattening it.
The two keys that always work
Before any config, know these:
- Ctrl+J inserts a newline. It is a control character the terminal passes through unchanged, so it works in every terminal, over SSH, inside tmux, everywhere.
- Backslash, then Enter. End the line with
\and press Enter, and Claude Code continues on a new line.
If you only ever learn one, learn Ctrl+J. Your fingers will thank you on remote machines.
Shift+Enter support by terminal
| Terminal | Shift+Enter out of the box | What to do |
|---|---|---|
| Ghostty | Yes | Nothing |
| iTerm2 | Yes | Nothing |
| Kitty | Yes | Nothing |
| WezTerm | Yes | Nothing |
| Warp | Yes | Nothing |
| Apple Terminal | Yes | Nothing |
| Windows Terminal | Yes | Nothing |
| Alacritty 0.16+ | Yes (recent Claude Code) | Update both if it fails |
| VS Code, Cursor, Zed | No | Run /terminal-setup once |
| Alacritty before 0.16 | No | Run /terminal-setup once |
| gnome-terminal, JetBrains IDE terminals | Not available | Use Ctrl+J |
| MOLTamp | Yes | Nothing |
| Anything inside tmux | Depends on tmux config | See the tmux section |
This matches the Claude Code terminal configuration docs as of late 2026. Terminal apps update often, so if your terminal is listed as working and it does not, update the terminal first.
Fix 1: run /terminal-setup (VS Code, Cursor, Zed, old Alacritty)
Inside a Claude Code session, run:
/terminal-setup
It writes a Shift+Enter keybinding into your host terminal's own config. In VS Code and Cursor it edits your keybindings (and also turns off GPU acceleration for the integrated terminal, which fixes a separate rendering issue). In Zed it updates keymap.json. Restart the terminal afterward.
Two gotchas. First, run it outside tmux or screen, because it needs to detect the real terminal. Second, it changes the terminal's config, not Claude Code's, so if you use several terminals you run it once in each one that needs it.
Fix 2: tmux is eating your Shift+Enter
This is the most common reason Shift+Enter works in a plain window and breaks the moment you open tmux. By default tmux does not forward the extended key sequence, so it reaches Claude Code as a plain Enter. Add this to ~/.tmux.conf:
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
While you are there, add the two lines that make Claude Code's notifications and progress bar reach your outer terminal:
set -g allow-passthrough on
set -g focus-events on
Reload with tmux source-file ~/.tmux.conf. If it still fails, fully restart the tmux server (tmux kill-server) so the option applies to new sessions. Our Claude Code in tmux guide covers the rest of the tmux setup.
Fix 3: Option+Enter on a Mac
Option+Enter also inserts a newline, but only if your terminal sends Option as Meta. Apple Terminal: Settings, Profiles, Keyboard, "Use Option as Meta Key". iTerm2: set the Option keys to "Esc+". VS Code: set terminal.integrated.macOptionIsMeta to true. This is worth doing anyway, because other Claude Code shortcuts use Option too. Our Claude Code keyboard shortcuts post lists them.
Fix 4: write long prompts somewhere else
For a truly long prompt, press Ctrl+G to open it in your $EDITOR, write it with a real editor, save and close. Or paste: multi-line pasted text stays multi-line. Some people keep a scratch file and paste the finished prompt in, which also means they keep a copy when the session ends.
Still broken? Check these
- You are over SSH. The remote side may not know your terminal type. Ctrl+J still works.
- A keyboard remapper (Karabiner, BetterTouchTool, a VS Code extension) is intercepting Shift+Enter.
- An old Claude Code. Run
claude updateor reinstall with the native installer. - You ran
/terminal-setupinside tmux. Exit tmux, run it again in the outer terminal.
The bigger picture
A newline key sounds trivial, but it decides whether you write one clear prompt or five fragments. If you are choosing a terminal for Claude Code anyway, pick one where this simply works.
MOLTamp handles Shift+Enter out of the box: it sends the meta-Enter sequence Claude Code treats as "insert newline", so there is nothing to configure. It is a skinnable terminal shell for Claude Code and other agent CLIs on Mac, with up to 50 tabs, attention badges for sessions that need you, and full skins, widgets and visualizers. Free to use, with a one-time $10 license to remove a recurring popup. Download MOLTamp or compare it with Ghostty, iTerm2 and others in the best terminal for Claude Code round-up.
FAQ
How do I add a new line in Claude Code? Press Shift+Enter in most terminals, or Ctrl+J in any terminal. Typing a backslash and then Enter also works everywhere.
Why does Shift+Enter submit in Claude Code in VS Code?
VS Code's integrated terminal sends the same sequence for Enter and Shift+Enter by default. Run /terminal-setup once inside Claude Code to add a keybinding that fixes it.
Why does Shift+Enter stop working in tmux?
tmux does not forward extended keys by default. Add set -s extended-keys on and set -as terminal-features 'xterm*:extkeys' to ~/.tmux.conf and reload.
Does Shift+Enter work in Ghostty and iTerm2? Yes. Both support Shift+Enter for a newline in Claude Code without any configuration.
What is the Ctrl+G shortcut in Claude Code? Ctrl+G opens your current prompt in your default text editor, which is handy for long, multi-line prompts.