← Blog · 2026-11-08
Claude Code Shift+Enter Not Working? 12 Fixes for New Lines, Option Keys and Notifications
10-second fix: press
Ctrl+J, or type\and then pressEnter. Both insert a new line without sending, in every terminal, with no setup. If you want Shift+Enter specifically, find your terminal in the table below: in VS Code, Cursor, Zed and older Alacritty you run/terminal-setuponce; in gnome-terminal and JetBrains IDEs Shift+Enter isn't available at all; inside tmux you need the four lines in fix 4.
Claude Code works in any terminal without configuration, but your terminal decides which key signals actually reach it. Plain Enter always submits. Whether Shift+Enter arrives as something different from Enter depends on the terminal emulator:
| Terminal | Shift+Enter for a new line |
|---|---|
| Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal, Windows Terminal | Works without setup |
| Other terminals with the kitty keyboard protocol, such as foot and Alacritty 0.16+ | Works without setup on Claude Code v2.1.269 or later |
| VS Code, Cursor, Devin Desktop, Alacritty before 0.16, Zed | Run /terminal-setup once |
| gnome-terminal, JetBrains IDEs such as PyCharm and Android Studio | Not available: use Ctrl+J or \ then Enter |
Shift+Enter submits instead of adding a new line: 6 fixes
- Use a key that works everywhere.
Ctrl+Jand\+Enterinsert a line break in every terminal. On macOS,Option+Enteralso works once Option is set up as Meta (fix 7). Pasting multi-line text keeps its line breaks too, so for a long prompt you can write it in an editor and paste it in. These are the only options in gnome-terminal and JetBrains IDE terminals, where Shift+Enter can't be told apart from Enter. - Your terminal needs
/terminal-setup. In the VS Code, Cursor and Devin Desktop integrated terminals, Alacritty before 0.16 and Zed, run/terminal-setuponce inside Claude Code. It writes a Shift+Enter keybinding into that terminal's configuration file, and on the first run prints a confirmation such asInstalled VSCode terminal Shift+Enter key binding. If it prints... key binding already configured, it found an existing binding and changed nothing. In VS Code, Cursor and Devin Desktop it also setsterminal.integrated.gpuAccelerationto"off"(to stop garbled text) and adjuststerminal.integrated.mouseWheelScrollSensitivity; set GPU acceleration back to"auto"and reload the window if you want to undo that. - You ran
/terminal-setupinside tmux or screen. It has to write to the host terminal's configuration, so run it directly in the outer terminal, not in a tmux or screen pane. - You're inside tmux. By default tmux can't tell Shift+Enter from Enter, so it submits even when your outer terminal supports it. Add these lines to
~/.tmux.conf, then runtmux source-file ~/.tmux.confto apply them to the running server:
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
The two extended-keys lines are what make Shift+Enter work; allow-passthrough is for notifications (fix 10). If you also hit Ctrl+B in Claude Code, remember it's tmux's prefix key, so press it twice.
- Zed's keymap couldn't be updated. In Zed,
/terminal-setupmerges the binding into yourkeymap.jsonand first backs it up to a copy such askeymap.json.1a2b3c4d.bakin the same folder. If Claude Code can't read, parse or back up the keymap, or can't verify the merged result, it leaves the file unchanged and prints the keybinding block for you to add by hand. Paste that block intokeymap.jsonyourself. - You want different keys. To use another key for a new line, or to swap the behavior so
Enteradds a line andShift+Entersends, map thechat:newlineandchat:submitactions in theChatcontext of~/.claude/keybindings.json(run/keybindingsto create or open it). For example"shift+enter": "chat:newline"and"enter": "chat:submit"inside{"bindings": [{"context": "Chat", "bindings": {...}}]}. A remap can't make a terminal send a key it doesn't send, so this doesn't help in gnome-terminal or JetBrains. If a binding never fires, startclaude --debug: Claude Code writes a warning to the debug log for invalid JSON, misspelled modifiers such asctl+k, a space next to+(which turns the key into a chord that never matches), unknown actions and reserved shortcuts.Ctrl+C,Ctrl+DandCtrl+M(always Enter) can't be rebound.
Option shortcuts do nothing on a Mac: 1 fix
- Turn on Option as Meta. Shortcuts such as
Option+Enter(new line) andOption+P(switch model) need the terminal to send Option as a modifier, which most macOS terminals don't by default:- Apple Terminal: Settings → Profiles → Keyboard → tick "Use Option as Meta Key". If you accepted Claude Code's first-run terminal setup prompt, this is already done.
- iTerm2: Settings → Profiles → Keys → General → set Left and Right Option key to "Esc+".
- VS Code terminal: add
"terminal.integrated.macOptionIsMeta": trueto your VS Code settings. - Ghostty, Kitty and others: look for an Option-as-Alt or Option-as-Meta setting in the terminal's config file.
No sound or alert when Claude finishes: 3 fixes
- Your terminal gets no notification by default. Claude Code sends a desktop notification on its own only in Ghostty, Kitty and iTerm2 (iTerm2 also needs its alert settings on: Settings → Profiles → Terminal → "Notification Center Alerts", then Filter Alerts → "Send escape sequence-generated alerts"). Apple Terminal gets at most a silent bell character, and other terminals, including Warp and the VS Code integrated terminal, get nothing. To ring the bell everywhere, add
"preferredNotifChannel": "terminal_bell"to~/.claude/settings.json; in Apple Terminal also turn on Audible bell under Settings → Profiles → Advanced to hear it. If the key seems ignored, our settings not applying guide shows which settings file wins. - You want a real sound or desktop pop-up in any terminal. Add a
Notificationhook. It runs alongside the built-in notification, so it works in terminals that get nothing. On macOS this plays a sound:
{
"hooks": {
"Notification": [
{ "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" }] }
]
}
}
Our free hooks settings generator builds the JSON for you, and Claude Code hooks not working covers a hook that never fires. If the alert still doesn't appear, check that your terminal app has notification permission in your OS settings.
- Notifications don't get out of tmux or SSH. Inside tmux, keep
set -g allow-passthrough onfrom fix 4 and setpreferredNotifChannelto"iterm2","kitty"or"ghostty"to match your outer terminal; a pane in a tmux window you aren't viewing still sends nothing. Over SSH (outside tmux), setpreferredNotifChannelto your local terminal's value on the machine running Claude Code, and the notification reaches your local machine. A missed alert is a common reason a session looks stuck or not responding when it's really waiting on a permission prompt.
Other keyboard and display problems: 2 fixes
- Backspace deletes a whole word on Windows. On Windows, Claude Code reads a Backspace that arrives as
^Has Ctrl+Backspace, which deletes the previous word (except whenTERM_PROGRAMisminttyorTERMiscygwin). If every Backspace eats a word, setCLAUDE_CODE_BS_AS_CTRL_BACKSPACE=0. If Ctrl+Backspace erases only one character on macOS or Linux, set it to1instead. More Windows issues are in Claude Code not working on Windows. - The display flickers, scrollback jumps or text is garbled. Run
/tui fullscreento switch to fullscreen rendering (you then scroll inside Claude Code with the mouse or PageUp); your conversation relaunches intact and the choice is saved. Or start withCLAUDE_CODE_NO_FLICKER=1 claude. If flicker is the only problem and your terminal supports synchronized output but isn't detected, such as Emacseat, setCLAUDE_CODE_FORCE_SYNC_OUTPUT=1instead. Boxes or smeared characters in the VS Code, Cursor or Devin Desktop terminal usually mean the GPU renderer:/terminal-setupturns it off. Editor-side connection problems are in Claude Code IDE not connecting.
Two habits that help
- Vim users:
Enterstill submits in INSERT mode, unlike real Vim. UseoorOin NORMAL mode, orCtrl+J, for a new line. Turn Vim mode on or off with/config→ Editor mode, or"editorMode": "vim"in~/.claude/settings.json. - Very long prompts: when you paste more than 800 characters or more than three lines, Claude Code collapses it to a placeholder such as
[Pasted text #1 +120 lines]and still sends the full text. For whole files or long logs, save them to a file and ask Claude to read it; the VS Code integrated terminal can drop characters from very large pastes.
Facts on this page come from Anthropic's Claude Code docs on terminal configuration, interactive mode, keybindings, hooks and the settings reference. This guide isn't affiliated with Anthropic.
Made by Solo Stack Kits. Now that your keys work, keep Claude Code on a short leash. Start with our free Claude Code safety hooks, or get the Claude Code Power Config Pack with a tested needs-input notification hook, permission presets and 8 safety hooks, $6 with the launch code while it lasts.