# Claude Code new line: Ctrl+J, Shift+Enter and setup

> Enter submits your prompt in Claude Code. Ctrl+J or a backslash then Enter adds a line in every terminal, and Shift+Enter works in most once set up.

URL: https://claudegpt.si/news/claude-code-new-line  
Published: 2026-11-08T06:51:54.835Z  
Author: ClaudeGPT Si Newsroom  
Section: Guides  
Topics: Claude Code, Anthropic, Terminal, Keyboard shortcuts  
Publisher: ClaudeGPT Si

## Key takeaways

- Ctrl+J, or a backslash followed by Enter, adds a new line in every terminal with no setup.
- Shift+Enter works without setup in Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal and Windows Terminal.
- VS Code, Cursor, Devin Desktop, Zed and Alacritty before 0.16 need /terminal-setup run once, and gnome-terminal and JetBrains IDEs do not support Shift+Enter.

To add a new line in Claude Code without submitting your message, press Ctrl+J, or type a backslash (`\`) and then press Enter. Both work in every terminal with no setup. Shift+Enter also works in many terminals, and `/terminal-setup` turns it on in a few more, according to the [Claude Code terminal documentation](https://code.claude.com/docs/en/terminal-config).

Enter submits your prompt, so a plain Enter press never adds a line. The rest of this page covers which shortcut works where, and what to do when none of them seems to.

## How to type a new line in the Claude Code prompt

These are the methods the docs list, from the one that always works to the ones that depend on your terminal.

| Method | Works in | Setup |
| --- | --- | --- |
| Ctrl+J | Every terminal | None |
| `\` then Enter | Every terminal | None |
| Shift+Enter | Most terminals (table below) | None in some, `/terminal-setup` in others |
| Option+Enter | macOS terminals | Option must be sent as Meta (see below) |

On Windows and Linux, use Ctrl+J or the backslash. They need no configuration. The docs call out one case where Shift+Enter is not available at all: gnome-terminal and JetBrains IDE terminals such as PyCharm and Android Studio. Use Ctrl+J or `\` then Enter there.

## Does Shift+Enter work in your terminal

Support varies by terminal emulator. This is the table from the docs, as of November 8, 2026.

| Terminal | Shift+Enter for a new line |
| --- | --- |
| Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal, Windows Terminal | Works without setup |
| Other terminals with kitty keyboard protocol support, such as foot and Alacritty 0.16 or later | 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 | Not available |

## How to run /terminal-setup

Open Claude Code in the terminal that needs it and type:

```
/terminal-setup
```

The command writes a Shift+Enter keybinding into the terminal's own configuration file. On the first run you see a message such as `Installed VSCode terminal Shift+Enter key binding`. If you see `VSCode terminal Shift+Enter key binding already configured`, nothing changed, because existing bindings are left in place.

Run it in the host terminal, not inside tmux or screen, because it needs to write to the host terminal's configuration. A few details from the docs:

- In VS Code, Cursor and Devin Desktop it also sets `terminal.integrated.gpuAcceleration` to `"off"` to prevent garbled text, and adjusts `terminal.integrated.mouseWheelScrollSensitivity`. To undo the GPU change, set it back to `"auto"` and reload the window.
- In Zed it edits `keymap.json`. If the file already has bindings, Claude Code first saves a backup copy next to it, then merges the binding in. If it can't read, back up or verify the file, it leaves it unchanged and prints the block for you to add yourself.

## Why Shift+Enter submits in tmux

Inside tmux, Shift+Enter submits by default, even when the outer terminal supports it. The docs say to add these lines to `~/.tmux.conf`, then run `tmux source-file ~/.tmux.conf`:

```bash
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
```

The `extended-keys` lines let tmux tell Shift+Enter apart from plain Enter. Until you add them, use Ctrl+J or `\` then Enter.

## Why Option+Enter does nothing on a Mac

Option+Enter is another new-line shortcut, but on macOS most terminals don't send Option as a modifier by default. The setting is usually called "Use Option as Meta Key".

- **Apple Terminal:** Settings, then Profiles, then Keyboard, and check "Use Option as Meta Key". If you accepted Claude Code's first-run terminal setup prompt, this is already done.
- **iTerm2:** Settings, then Profiles, then Keys, then General, and set Left Option key and Right Option key to "Esc+".
- **VS Code:** add `"terminal.integrated.macOptionIsMeta": true` to your settings.

For Ghostty, Kitty and others, look for an Option-as-Alt or Option-as-Meta setting in the terminal's configuration file.

## How to change which key adds a new line

Claude Code lets you remap the keys. Map the `chat:newline` and `chat:submit` actions in your [keybindings file](https://code.claude.com/docs/en/keybindings) to bind a new line to another key, or to swap the behavior so Enter adds a line and Shift+Enter submits.

If you use Vim mode in the prompt, Enter still submits in INSERT mode. Press `o` or `O` in NORMAL mode, or Ctrl+J, to add a line instead.

## Pasting several lines

You don't need a shortcut to paste multi-line text. 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 content when you submit. For very large inputs, the docs suggest writing the text to a file and asking Claude to read it.

For more on the terminal itself, see our guide to the [Claude Code status line](https://claudegpt.si/news/claude-code-status-line-model-token-usage).

## Frequently asked questions

### How do I add a new line in Claude Code without sending the message?

Press Ctrl+J, or type a backslash and then press Enter. Both work in every terminal with no setup. Shift+Enter also works in most terminals.

### Why does Shift+Enter submit in Claude Code?

Your terminal may not send Shift+Enter as a separate key. In VS Code, Cursor, Zed and Alacritty before 0.16, run /terminal-setup once. Inside tmux, add the extended-keys lines to ~/.tmux.conf.

### What does /terminal-setup do in Claude Code?

It writes a Shift+Enter keybinding into the host terminal's configuration file. In VS Code, Cursor and Devin Desktop it also turns GPU acceleration off in the integrated terminal.

### How do I make Enter add a new line and Shift+Enter submit?

Map the chat:newline and chat:submit actions in your Claude Code keybindings file to swap the two behaviors.

## Sources

- [Configure your terminal for Claude Code](https://code.claude.com/docs/en/terminal-config), Anthropic
- [Customize keyboard shortcuts](https://code.claude.com/docs/en/keybindings), Anthropic
