Set up your terminal for Claude Code
Claude Code works in any terminal without setup. This page is for when one specific thing misbehaves: Shift+Enter sends your message, Option shortcuts do nothing, you never hear when a long task ends, or the screen flickers. Find your symptom and skip the rest.
Shift+Enter sends instead of adding a new line
Enter submits your message. To add a line break without submitting, press Ctrl+J, or type \ and then press Enter. Both work in every terminal with no setup. Shift+Enter also works in many terminals, but it depends on the one you use:
- No setup needed: Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal and Windows Terminal. Terminals that support the kitty keyboard protocol, such as foot and recent Alacritty, work too on a recent enough Claude Code.
- Run
/terminal-setuponce: VS Code, Cursor, Zed and older Alacritty. It writes a Shift+Enter binding into the terminal's configuration file and leaves existing bindings alone. Run it in the host terminal itself, not inside tmux or screen. - Not available: gnome-terminal and JetBrains IDEs such as PyCharm. Use Ctrl+J or
\then Enter.
In VS Code and Cursor, /terminal-setup also turns the editor's GPU acceleration for the terminal off, which prevents garbled text (see fixing a slow or stuck session). To make Enter insert a newline and Shift+Enter submit, map the chat:newline and chat:submit actions in your keybindings file; the shortcuts guide has the basics.
Option-key shortcuts do nothing on macOS
Some shortcuts use Option, such as Option+Enter for a newline or Option+P to switch models. Most macOS terminals don't send Option as a modifier by default; the setting is usually called "Use Option as Meta Key".
- Apple Terminal: Settings, Profiles, Keyboard, tick "Use Option as Meta Key".
- iTerm2: Settings, Profiles, Keys, General, set both Option keys to "Esc+".
- VS Code: add
"terminal.integrated.macOptionIsMeta": trueto its settings.
Other terminals have an Option-as-Alt or Option-as-Meta setting in their own configuration.
A sound or alert when Claude finishes
When Claude finishes or stops to ask permission and you seem to be away, it fires a notification event. By default Ghostty, Kitty and iTerm2 get a desktop notification (iTerm2 only once you turn on its alert settings), Apple Terminal gets a silent bell character in some cases, and other terminals get nothing. To send the bell character whatever the terminal, put this in ~/.claude/settings.json:
{
"preferredNotifChannel": "terminal_bell"
}
In Apple Terminal also turn on "Audible bell" under Settings, Profiles, Advanced to hear it. For a sound or custom command in any terminal, use a Notification hook; hooks run alongside the built-in notification. The desktop notification reaches your local machine over SSH too. If notifications still don't appear, check that your terminal app has notification permission in your operating system.
Running inside tmux
By default inside tmux, Shift+Enter submits, and desktop notifications and the progress bar never reach the outer terminal. Add these lines to ~/.tmux.conf, then run tmux source-file ~/.tmux.conf:
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
The first line lets notifications and progress updates through. The extended-keys lines let tmux tell Shift+Enter from Enter.
Backspace deletes a whole word on Windows
On Windows, Claude Code reads a Backspace that arrives as ^H as Ctrl+Backspace, which deletes the previous word. If every press deletes a word, set the environment variable CLAUDE_CODE_BS_AS_CTRL_BACKSPACE=0. If instead Ctrl+Backspace erases only one character on macOS or Linux, set it to 1.
Colors and the screen flickering
Use /theme (or the picker in /config) to match your terminal; the auto option follows your light or dark background. If the display flickers or the scroll position jumps while Claude works, run /tui fullscreen, which saves the choice. You then scroll with the mouse or PageUp inside Claude Code rather than with your terminal's own scrollback. The same switch is available as CLAUDE_CODE_NO_FLICKER=1, in your shell or in the env block of settings.json (see which settings file wins). In a very wide window, maxProseWidth in your settings wraps Claude's prose at a set number of columns.
Big pastes
Pasting more than 800 characters or more than three lines collapses the input into a placeholder like [Pasted text #1 +120 lines], and the full content is still sent when you submit. For entire files or long logs, write the content to a file and ask Claude to read it. The VS Code integrated terminal can also drop characters from very large pastes, so use a file there. The docs also say Claude is told that pasted text may contain instructions you didn't write and to follow them only where your own message asks it to.
Vim keys in the prompt
Turn it on in /config under Editor mode, or set "editorMode": "vim" in ~/.claude/settings.json. It covers a subset of Vim motions and operators. Unlike standard Vim, Enter still submits in INSERT mode; use o or O in NORMAL mode, or Ctrl+J, for a new line.
You can also show the model, folder and git branch at the bottom of the screen with a custom status line. All the guides are in the guides index.
This follows Anthropic's terminal configuration documentation as we read it in October 2026. We are not affiliated with Anthropic. We wrote this from the documentation and have not tested every terminal. Terminals, shortcuts and defaults change between versions (some items need a recent version), and where this page and the documentation disagree, the documentation wins.
See also: Customize keyboard shortcuts · Keyboard shortcuts worth learning · Fix “command not found: claude” · Fullscreen mode: flicker and scrolling · Claude Code in VS Code.
The free loop-stop skill gives long tasks a limit and a stop rule. If you want a second pair of eyes on your CLAUDE.md and settings, the Tune-Up Kit is a checklist for exactly that.