GuidesHosting choices

Claude Code new line: Shift+Enter, Ctrl+J and /terminal-setup

Add a line break in Claude Code without sending: Ctrl+J or \ then Enter, which terminals do Shift+Enter, what /terminal-setup changes, and tmux.

November 21, 2026The Everpod team
The short answer

Enter sends the prompt. To start a new line instead, press Ctrl+J, or type \ and then press Enter: Anthropic documents both as working in every terminal with no setup. Shift+Enter works out of the box in Ghostty, Kitty, iTerm2, WezTerm, Warp and Windows Terminal 1.25 or later; in VS Code, Cursor, Zed and older Alacritty, run /terminal-setup once; in gnome-terminal and JetBrains IDEs it is not available. Inside tmux, Shift+Enter sends the prompt until you turn on tmux’s extended-keys. On a Mac, Option+Enter also works once the terminal treats Option as Meta.

The keys that always work

In Vim editor mode, Enter still sends from INSERT mode; use o or O in NORMAL mode, or Ctrl+J.

Shift+Enter, terminal by terminal

Shift+Enter only works if the terminal sends something different from plain Enter, and not all of them do. As of November 2026, Anthropic’s terminal page sorts them like this:

Apple’s Terminal.app is not in the Shift+Enter table; on a Mac the documented route there is Option+Enter, below.

What /terminal-setup changes

/terminal-setup edits your terminal’s own configuration, so run it in a terminal window on the machine you are sitting at, not inside tmux or screen. What it does depends on the terminal:

Option+Enter on a Mac

Option+Enter inserts a new line once the terminal sends Option as a modifier, which most Mac terminals do not by default:

Inside tmux

Inside tmux, Shift+Enter sends the prompt by default, even when the terminal around it supports Shift+Enter: tmux’s manual says that with extended-keys off “only standard keys are reported”. Anthropic gives these two lines for ~/.tmux.conf on the machine where tmux runs:

set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
Copied

Then run tmux source-file ~/.tmux.conf, detach, attach again and restart Claude Code. The outer terminal still has to be one where Shift+Enter works on its own. Anthropic’s full tmux snippet adds allow-passthrough and focus-events for notifications, covered in the notifications guide. If you are new to tmux, start with what tmux is and why it keeps a session alive.

Anthropic does not document Shift+Enter inside GNU screen. There, and anywhere you are unsure, use Ctrl+J.

Over SSH

Anthropic’s pages do not cover SSH on its own. What follows is inference from how terminals work: keys are encoded by the terminal on the device you type on, and SSH carries those bytes through unchanged, so Shift+Enter on a server should behave as it does locally in that terminal. Running /terminal-setup on the server cannot help, since the configuration it edits lives on your own machine. If the server session runs inside tmux, as it usually should when you run Claude Code on a VPS, the tmux settings above go in the server’s ~/.tmux.conf. From a phone SSH app, whose Shift+Enter handling varies, \ then Enter is the dependable choice (more in using Claude Code from your phone).

Pasting multi-line text

Pasting keeps the line breaks and does not send the prompt. A paste of more than 800 characters or more than three lines collapses to a placeholder such as [Pasted text #1 +120 lines]; the full text is still sent when you press Enter. For whole files or long logs, Anthropic suggests saving them to a file and asking Claude to read it, and says the VS Code integrated terminal can drop characters from very large pastes.

Changing the keys

To use another key for a new line, or to make Enter insert a line and Shift+Enter send, map the chat:newline and chat:submit actions in ~/.claude/keybindings.json (/keybindings opens it; changes apply without a restart). The keybindings reference lists the actions. A swapped Shift+Enter still depends on the terminal sending it, so the table above applies either way.

Run Claude Code on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.